anacoelhovicente/wp-graphql-autodescription

为 WPGraphQL Schema 添加对 SEO 框架的支持

v1.0.1 2022-07-22 13:33 UTC

This package is auto-updated.

Last update: 2024-09-22 19:16:39 UTC


README

此插件将 SEO 框架支持添加到 WP GraphQL。

支持

  • 页面
  • 文章
  • 自定义文章类型
  • 分类
  • 自定义分类法
  • SEO 框架设置
    • 网站管理员验证
    • 社交设置
    • Schema 存在性

预要求

使用此插件需要已安装和激活 WPGraphQLSEO 框架(免费版或专业版)。

激活

像激活任何其他 WordPress 插件一样激活该插件。

一旦插件激活,任何文章对象连接查询(文章、页面、自定义文章类型等)都将可用 seo 参数。

用法

文章类型数据

query PostsSeo {
  posts(first: 10) {
    nodes {
      seo {
        title
        description
        canonical
        images {
          altText
          uri
          mediaDetails {
            height
            width
          }
        }
        opengraph {
          description
          title
          type
        }
        twitter {
          description
          title
        }
        metaRobotsNofollow
        metaRobotsNoarchive
        metaRobotsNoindex
        redirect
      }
    }
  }
}

分类数据

query CategoriesSeo {
  categories(first: 10) {
    nodes {
      seo {
        title
        description
        canonical
        images {
          altText
          uri
          mediaDetails {
            height
            width
          }
        }
        opengraph {
          description
          title
          type
        }
        twitter {
          description
          title
        }
        metaRobotsNofollow
        metaRobotsNoarchive
        metaRobotsNoindex
        redirect
      }
    }
  }
}

设置数据

query SeoSettings {
  seoSettings {
    separator
    presence {
      logo
      name
      type
    }
    webmaster {
      baiduVerification
      googleVerification
      pinterestVerification
      yandexVerification
      bingVerification
    }
    social {
      facebook {
        appId
        authorFallback
        publisher
      }
      twitter {
        authorFallback
        cardType
        profile
      }
    }
  }
}