Repository navigation
Write SEO title and description for category and tag archives - #26
Merged
Merged
Conversation
Terms of every archive taxonomy (category, post_tag, product_cat, product_tag and other public taxonomies with archive pages) are now sent with the content sync after the posts, as content items with id "term:<taxonomy>:<term_id>", term_id and taxonomy. Their SEO title and meta description come from Rank Math term meta, Yoast's wpseo_taxonomy_meta option, or, without an SEO plugin, the term description. A change may now name term_id and taxonomy instead of post_id. The SEO title and meta description are written into Rank Math term meta, Yoast's taxonomy meta (through WPSEO_Taxonomy_Meta::set_values with the term's other values kept, then Yoast's indexable is rebuilt), or the term description when no SEO plugin is active. Titles without an SEO plugin and any other SEO plugin are refused with not_supported. The expected value is checked like posts, the archive URL is purged from page caches, and undo works through the change log. Status reports "term_seo" in can_write and term counts per taxonomy. Created, edited and deleted terms are pushed as live changes. Version 0.1.24 (no release). Closes #25
…Yoast does not count it as skipped
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #25
What changes
id: "term:<taxonomy>:<term_id>",type: "term:<taxonomy>",term_id,taxonomy). Terms with no posts are left out, like unpublished posts. Post formats are left out.term_idandtaxonomyinstead ofpost_id, forseo_titleandseo_description.rank_math_title/rank_math_descriptionterm meta.wpseo_taxonomy_metathroughWPSEO_Taxonomy_Meta::set_values(), with the term's other values passed back so they are kept, then Yoast's term indexable is rebuilt.not_supported).not_supported).changed_since_previewwithcurrent), archive URL purged from page caches, undo through the change log works.term_seoincan_writewhen the setup supports it, plustaxonomies(term counts)./changes.Tests
vendor/bin/phpunit, 114 tests pass (newtests/unit/TermSeoTest.php: none / Rank Math / Yoast / other plugin, expected check, undo, cache purge, paging, status, live changes).tests/integration/TermSeoTest.phppasses without plugins and with Yoast SEO 28.5 loaded (MONORANKS_WP_PLUGINS=wordpress-seo/wp-seo.php), including the rebuilt Yoast indexable. Rank Math was not installed locally, so it is covered by unit tests only.