moonmeister / wp-graphql-seopress
使用wp-graphql查询SEOPress数据
v2.1
2021-10-14 12:51 UTC
Requires
- wp-graphql/wp-graphql: >=0.6.1
Requires (Dev)
This package is auto-updated.
Last update: 2024-09-30 01:59:51 UTC
README
嘿,你在这里!你使用这个包吗?想要让它变得更好?告诉我,我可能会把你添加为贡献者,因为我没有足够的时间。
WPGraphQL SEOPress 插件
这是 WPGraphQL 插件(https://github.com/wp-graphql/wp-graphql)的一个扩展,它返回 SEOPress 数据。
目前返回页面、帖子、自定义帖子类型、分类和自定义分类的数据。
使用这个插件?我很想看看你用它做了什么。@moon_meister
上游源
这是@ash_hitchcock在原始Yoast SEO 插件上的直接结果。让他知道你喜欢他的工作!
快速安装
- 安装并激活 WPGraphQL
- 将此存储库的 zip 文件克隆或下载到你的 WordPress 插件目录中,并激活 WPGraphQL for SEOPress 插件
Composer
composer require moonmeister/wp-graphql-seopress
用法
要查询帖子或页面上的 SEOPress 数据,你可以将这些添加到你的帖子/页面查询中
{
pages(first: 10) {
edges {
node {
id
title
seo {
metaTitle
metaDesc
canonicalUrl
metaRobotsNoindex
metaRobotsNofollow
metaRobotsArchive
metaRobotsBreadcrumbs
metaRobotsImageIndex
metaRobotsOdp
metaRobotsPrimaryCategory
metaRobotsSnippet
metaNewsDisabled
metaVideo
metaVideoDisabled
redirectionsEnabled
redirectionsType
redirectionsURL
targetKeywords
proSchemas
proSchemasManual
hasProLicense
opengraphTitle
opengraphDescription
opengraphImage {
altText
sourceUrl
srcSet
}
twitterTitle
twitterDescription
twitterImage {
altText
sourceUrl
srcSet
}
}
}
}
}
}
SEOPress 的设置如下
{
seoPressSettings {
hasProLicense
advanced {
addEditorToTaxonomy
addSiteVerificationBing
addSiteVerificationGoogle
addSiteVerificationPinterest
addSiteVerificationYandex
automaticImageAltText
automaticImageAltTextFromKeywords
automaticImageCaption
automaticImageDescription
automaticImageTitle
enableCanonicalUrlColumn
enableContentAnalysisScoreColumn
enableMetaDescriptionColumn
enableNofollowColumn
enableNoindexColumn
enablePageSpeedColumn
enableRedirectUrlColumn
enableRedirectionEnableColumn
enableTargetKeywordColumn
enableTitleTagColumn
enableTotalWordsColumn
enableUniversalSeoMetabox
metaboxSeoPosition
metaboxStructuredDataDefaultTab
permissionAdvancedPageSettings
permissionAnalyticsPageSettings
permissionBotPageSettings
permissionMetaboxContentAnalysis
permissionMetaboxSEO
permissionProPageSettings
permissionSocialNetworksPageSettings
permissionStructuredDataTypesMetabox
permissionTitlesMetasPageSettings
permissionToolsPageSettings
permissionXmlHtmlSitemapPageSettings
redirectAttachmentPagesToFile
redirectAttachmentPagesToParent
removeAdviceStructuredDataMetabox
removeCategoryInUrl
removeCommentAuthorUrl
removeCommentFormWebsiteInput
removeContentAnalysisMetabox
removeGeneratorMeta
removeGenesisSeoFromAdminBar
removeGenesisSeoMetabox
removeHentryPostClass
removeNoindexFromAdminBar
removeNotificationCenter
removeProductCategoryInUrl
removeReallySimpleDiscoveryMeta
removeReplytocom
removeSeoAdminBar
removeSeoNews
removeSeoTools
removeShortlinkMeta
removeTrailingSlashMetas
removeUniversalSeoMetabox
removeWindowsLiveWriterMeta
}
analytics {
additionalTrackingBody
additionalTrackingFooter
additionalTrackingHead
cookieConsentAcceptButtonBackgroundColor
cookieConsentAcceptButtonBackgroundColorHover
cookieConsentAcceptButtonColor
cookieConsentAcceptButtonColorHover
cookieConsentAutomatic
cookieConsentBackdropColor
cookieConsentBackdropCustomized
cookieConsentBackgroundColor
cookieConsentBarWidth
cookieConsentChangeChoice
cookieConsentCloseBackgroundColor
cookieConsentCloseBackgroundColorHover
cookieConsentCloseColor
cookieConsentCloseColorHover
cookieConsentCookieValidity
cookieConsentLinkColor
cookieConsentOptOutClose
cookieConsentOptOutEdit
cookieConsentOptOutMessage
cookieConsentOptOutMessageOk
cookieConsentPosition
cookieConsentRequired
cookieConsentTextAlign
cookieConsentTextColor
googleAnalyticsAdWords
googleAnalyticsAffiliateTracking
googleAnalyticsAffiliateTrackingEnable
googleAnalyticsApiClientId
googleAnalyticsApiSecretId
googleAnalyticsCrossDomainList
googleAnalyticsCrossEnable
googleAnalyticsCustomDimensionAuthor
googleAnalyticsCustomDimensionCategory
googleAnalyticsCustomDimensionLoggedIn
googleAnalyticsCustomDimensionPostType
googleAnalyticsCustomDimensionTag
googleAnalyticsDashboardWidget
googleAnalyticsDownloadTracking
googleAnalyticsDownloadTrackingEnable
googleAnalyticsEnable
googleAnalyticsEventAddToCart
googleAnalyticsEventPurchases
googleAnalyticsEventRemoveFromCart
googleAnalyticsGA4Code
googleAnalyticsHtmlLocation
googleAnalyticsIpAnonymization
googleAnalyticsLinkAttribution
googleAnalyticsLinkTrackingEnable
googleAnalyticsNoTrackRoles
googleAnalyticsOptimize
googleAnalyticsRemarketing
googleAnalyticsUACode
matomoCrossDomainTracking
matomoCrossDomainTrackingList
matomoEnable
matomoHonorDoNotTrack
matomoHost
matomoLinkDownloadTracking
matomoNoCookies
matomoNoHeatmaps
matomoPrependDomain
matomoSiteId
matomoSubdomainTracking
matomoTrackWithoutJavascript
}
pro {
breadcrumbsEnabled
breadcrumbsI18n404
breadcrumbsI18nAuthor
breadcrumbsI18nHere
breadcrumbsI18nHome
breadcrumbsI18nNoResults
breadcrumbsI18nSearch
breadcrumbsJsonEnabled
breadcrumbsPostTypeShownCustomPostType {
category
postTag
productCategory
productTag
}
breadcrumbsPostTypeShownTaxonomy {
page
post
product
}
breadcrumbsRemoveDefaultSeparator
breadcrumbsRemoveStaticPosts
breadcrumbsRemoveStaticShopPage
breadcrumbsSeparator
dublinCoreEnabled
easyDigitalDownloadsAddProductPriceAmountMeta
easyDigitalDownloadsAddProductPriceCurrencyMeta
easyDigitalDownloadsRemoveGeneratorMeta
googleNewsEnabled
googleNewsName
googleNewsPostTypes
localBusinessCity
localBusinessCountry
localBusinessCuisine
localBusinessLatitude
localBusinessLongitude
localBusinessOpeningHours {
monday
}
localBusinessPhone
localBusinessPlaceId
localBusinessPostalCode
localBusinessPriceRange
localBusinessSchemaPage
localBusinessState
localBusinessStreetAddress
localBusinessType
localBusinessUrl
notFoundCleaningEnabled
notFoundEmailNotificationAddress
notFoundEmailNotificationEnabled
notFoundEmailNotificationNoAutomaticRedirect
notFoundIpLogging
notFoundMonitoringEnabled
notFoundRedirectTo
notFoundRedirectToCustomUrl
notFoundRedirectionStatusCode
rewriteSearchUrl
richSnippetsEnabled
richSnippetsPublisherLogo
richSnippetsPublisherLogoHeight
richSnippetsPublisherLogoWidth
richSnippetsSiteNavigation
robotsFileContents
robotsFileEnabled
rssAllDisabled
rssCommentsDisabled
rssExtraDisabled
rssHtmlPrefix
rssHtmlSuffix
rssPostsDisabled
whiteLabelFilterSeoDashiconsClass
whiteLabelRemoveAdminHeader
whiteLabelRemoveCredits
whiteLabelRemoveHeaderIcons
whiteLabelRemoveHelpDocumentationIcons
whiteLabelRemoveViewDetails
whiteLabelSEOPressAdminBarImage
whiteLabelSEOPressAdminBarTitle
whiteLabelSEOPressAuthor
whiteLabelSEOPressDescription
whiteLabelSEOPressMainMenuTitle
whiteLabelSEOPressName
whiteLabelSEOPressProDescription
whiteLabelSEOPressProName
whiteLabelSEOPressWebsite
woocommerceAddProductPriceAmountMeta
woocommerceAddProductPriceCurrencyMeta
woocommerceNoindexAccountPage
woocommerceNoindexCartPage
woocommerceNoindexCheckoutPage
woocommerceRemoveBreadcrumbsSchema
woocommerceRemoveDefaultJsonLdSchema
woocommerceRemoveGeneratorMeta
}
social {
accountFacebook
accountInstagram
accountLinkedIn
accountPinterest
accountTwitter
accountYoutube
facebookAdminId
facebookAppId
facebookImg {
altText
sourceUrl
srcSet
}
facebookImgCustomPostTypes {
product {
url
}
}
facebookImgDefault
facebookLinkOwnershipId
facebookOg
knowledgeContactOption
knowledgeContactType
knowledgeImg {
altText
sourceUrl
srcSet
}
knowledgeName
knowledgePhone
knowledgeType
twitterCard
twitterCardImg {
altText
sourceUrl
srcSet
}
twitterCardImgSize
twitterCardOg
}
titlesMetas {
archive_titles {
product {
description
nofollow
noindex
title
}
}
archives_404_desc
archives_404_title
archives_author_desc
archives_author_disable
archives_author_noindex
archives_author_title
archives_date_desc
archives_date_disable
archives_date_noindex
archives_date_title
archives_search_desc
archives_search_noindex
archives_search_title
attachments_noindex
home_site_desc
home_site_title
noarchive
nofollow
noimageindex
noindex
noodp
nositelinkssearchbox
nosnippet
paged_noindex
paged_rel
separator
single_titles {
page {
date
description
nofollow
noindex
thumb_gcs
title
}
post {
date
description
nofollow
noindex
thumb_gcs
title
}
product {
date
description
nofollow
noindex
thumb_gcs
title
}
}
tax_titles {
category {
description
disable
nofollow
noindex
title
}
post_tag {
description
disable
nofollow
noindex
title
}
productCategory {
description
disable
nofollow
noindex
title
}
productTag {
description
disable
nofollow
noindex
title
}
}
}
tools {
compatibilityAviaLayout
compatibilityDivi
compatibilityFusion
compatibilityOxygen
compatibilityWpBakery
}
xmlHtmlSitemap {
htmlArchiveLinks
htmlDate
htmlExclude
htmlMapping
htmlOrder
htmlOrderby
sitemapPostTypes {
attachment {
include
}
page {
include
}
post {
include
}
product {
include
}
}
sitemapTaxonomies {
category {
include
}
postTag {
include
}
productCategory {
include
}
productTag {
include
}
}
xmlSitemapAuthorEnabled
xmlSitemapGeneralEnabled
xmlSitemapHTMLEnabled
xmlSitemapImageEnabled
xmlSitemapVideoEnabled
}
}
}
说明
这可以用于生产,但它仍在积极开发中。
尽管这是一个很长的列表,但它不是完整的列表。请参考 WordPress 中的 GraphiQL IDE 获取更多查询和查询的文档。