Skip to content

Treat the WooCommerce cart, checkout and My account pages as noindexed - #65

Open
webdados wants to merge 3 commits into
ProgressPlanner:mainfrom
webdados:woocommerce-noindexed-pages
Open

webdados wants to merge 3 commits into
ProgressPlanner:mainfrom
webdados:woocommerce-noindexed-pages

Conversation

@webdados

Copy link
Copy Markdown
Contributor

With markdown_alternate_skip_noindexed on, the cart, checkout and My account pages still get a Markdown version, because is_noindexed() only reads Yoast SEO, and Yoast does not mark these pages noindex on a default setup. WooCommerce keeps them out of search itself, through wp_robots while the HTML page renders, which a Markdown request never sees. They depend on the customer and have nothing an agent can use.

Changes

  • PostTypeSupport::is_noindexed() passes Yoast's answer through a new filter, markdown_alternate_is_noindexed, so other plugins can mark posts noindexed by their own means.
  • The WooCommerce integration uses it for the cart, checkout and My account pages, matched with wc_get_page_id().
  • Every place that already honors the opt-in (the .md URL, ?format=markdown, the Accept redirect, the alternate link and llms.txt links) picks them up. Without the opt-in nothing changes.
  • README and readme.txt document the filter.

Tests

  • A standalone test for the filter in tests/run.php.
  • WooCommerce integration checks that the three pages are skipped only with the opt-in, and an ordinary page never.
  • PHPStan passes; the baseline only counts the new wc_get_page_id() call.

Drafted by Claude under my supervision and curation.

With markdown_alternate_skip_noindexed on, these three pages still got
a Markdown version, because is_noindexed() only reads Yoast SEO and
Yoast does not mark them noindex on a default setup. WooCommerce keeps
them out of search itself, through wp_robots while the HTML page
renders, which a Markdown request cannot see.

is_noindexed() now passes Yoast's answer through a new filter,
markdown_alternate_is_noindexed, and the WooCommerce integration uses
it for its cart, checkout and My account pages, matched with
wc_get_page_id(). Every place that already honors the opt-in (the .md
URL, ?format=markdown, the Accept redirect, the alternate link and
llms.txt links) picks them up. Without the opt-in nothing changes.

Tests: a standalone test for the filter, and WooCommerce integration
checks that the three pages are skipped only with the opt-in and an
ordinary page never. PHPStan passes; the baseline only counts the new
wc_get_page_id() call.
@github-actions

github-actions Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

WordPress Playground Preview

The changes in this pull request can previewed and tested using a WordPress Playground instance.

Open WordPress Playground Preview

@github-actions

github-actions Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

Plugin readme preview

Open preview · Commit 652d94c

24 passed · 2 warnings · 2 notes

Warnings

  • “Tested up to” is 7.2; the latest WordPress major release is 7.1. Test with 7.1 and update the header.
  • The Screenshots section is missing or has no captions.
Notes (2)
  • No banner loaded. Add banner-772x250.png or banner-1544x500.png.
  • No icon loaded. A placeholder appears in the preview.
Passed checks (24)
  • 117 / 150 characters in the short description.
  • Plugin name header recognized.
  • License header recognized: GPLv2 or later.
  • 5 tags accepted within the five-tag limit.
  • Description is within the parser’s word limit.
  • Installation is within the parser’s word limit.
  • Faq is within the parser’s word limit.
  • Changelog is within the parser’s word limit.
  • Stable tag is declared: 1.3.0.
  • The PHP Version header is declared: 1.3.0.
  • Stable tag matches the PHP Version header: 1.3.0.
  • The readme “Requires at least” value is valid: 6.0.
  • The PHP “Requires at least” header is a numeric version: 6.0.
  • “Requires at least” matches between the readme and PHP header: 6.0.
  • The readme “Requires PHP” value is valid: 7.4.
  • The PHP “Requires PHP” header is a numeric version: 7.4.
  • “Requires PHP” matches between the readme and PHP header: 7.4.
  • “Tested up to” 7.2 meets the minimum WordPress version 6.0.
  • Installation content is present.
  • FAQ content is present.
  • Changelog content is present.
  • The first changelog release matches Stable tag: 1.3.0.
  • The first changelog release matches PHP Version: 1.3.0.
  • Plugin PHP header loaded.

Readme and PHP-header checks only; this does not test plugin runtime compatibility.

jdevalk and others added 2 commits November 27, 2026 14:23
Resolve the readme.txt changelog conflict: main released the earlier
Unreleased entries as 1.3.0, so only this branch's two entries stay
under Unreleased.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
1.3.0 was released before this filter was added.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
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