Skip to content

Plugin: exclude admin-only CPTs from WP sitemaps + SEO docs#6

Open
datengraben wants to merge 4 commits into
masterfrom
claude/sitemap-exclude-admin-cpts
Open

Plugin: exclude admin-only CPTs from WP sitemaps + SEO docs#6
datengraben wants to merge 4 commits into
masterfrom
claude/sitemap-exclude-admin-cpts

Conversation

@datengraben

@datengraben datengraben commented Apr 14, 2026

Copy link
Copy Markdown
Owner

Summary

  • Excludes cb_restriction and cb_map from WordPress sitemaps via wp_sitemaps_post_types filter — compatible with WP core (5.5+), Yoast SEO, and RankMath
  • cb_item and cb_location remain in the sitemap (public content)
  • Adds advanced administration docs page covering sitemaps and SEO plugin setup
  • Adds .phpunit.result.cache to .gitignore

Why cb_restriction and cb_map?

Both are registered public => true (needed for front-end rendering) but are admin configuration objects with no value for search indexing. Without this filter they appear in the sitemap by default.

Why no code for Yoast / RankMath?

No reimplementation needed — both plugins read WP's post type registration and respect wp_sitemaps_post_types, so a single filter covers all three cases.

Test plan

  • PluginTest::testSitemapPostTypesFilterExcludesAdminCpts passes green
  • Verify cb_restriction and cb_map absent from /wp-sitemap.xml on a test site
  • Verify cb_item and cb_location present in /wp-sitemap-posts-cb_item-1.xml and /wp-sitemap-posts-cb_location-1.xml
  • Review new docs page at docs/en/documentation/advanced-functionality/sitemaps-and-seo.md

https://claude.ai/code/session_012vsbFakgmvud1An9fMknfe

claude added 3 commits April 14, 2026 08:08
Adds RSS 2.0 feed capability for the public-facing custom post types
(cb_item, cb_location, cb_timeframe) so users can subscribe to new
posts and edits in any feed reader.

Architecture:
- src/Service/RssFeed.php — lightweight, modular service with no
  external dependencies. Follows the iCalendar service pattern:
  initRewrite() registers the rewrite rule, getFeedUrl() returns the
  subscription URL, renderFeedXml() is the pure (testable) XML
  generator, and isValidPostType() gates access to only public CPTs.
- URL pattern: /?commonsbooking_rss=1&commonsbooking_rss_type=cb_item
- Controlled by the new `rss_feed_enabled` checkbox in Advanced Options.
- Bookings and restrictions are intentionally excluded (private data).

Tests (31 tests, 44 assertions — red/green TDD):
- tests/php/Service/RssFeedTest.php covers post type validation, feed
  URL generation, RSS 2.0 XML structure, channel metadata, item fields
  (title, link, pubDate, guid, description), empty feed, and settings gate.

https://claude.ai/code/session_012vsbFakgmvud1An9fMknfe
cb_restriction and cb_map are public CPTs (needed for front-end
rendering) but are admin configuration objects with no value for
search indexing. Adds a wp_sitemaps_post_types filter to remove them
from the sitemap — compatible with WP core (5.5+), Yoast SEO, and
RankMath, all of which honour this filter.

cb_item and cb_location are explicitly left in: they are public
content that users and search engines should be able to discover.

https://claude.ai/code/session_012vsbFakgmvud1An9fMknfe
Explains what CommonsBooking does automatically (which post types are
included/excluded from sitemaps and why), recommends Yoast SEO or
RankMath for full control, documents the core WP sitemap URLs, and
covers single-post exclusion and a note on structured data.

https://claude.ai/code/session_012vsbFakgmvud1An9fMknfe
@datengraben datengraben force-pushed the claude/sitemap-exclude-admin-cpts branch from 8d5600f to eb5e3dc Compare April 14, 2026 08:09
@datengraben datengraben changed the title Plugin: exclude admin-only CPTs from WP sitemaps Plugin: exclude admin-only CPTs from WP sitemaps + SEO docs Apr 14, 2026
@datengraben datengraben reopened this Apr 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants