Skip to content

Restore legacy Woo behavior of handling permalinks#22923

Merged
thijsoo merged 3 commits intorelease/26.9from
block/woo-permalink-change
Jan 29, 2026
Merged

Restore legacy Woo behavior of handling permalinks#22923
thijsoo merged 3 commits intorelease/26.9from
block/woo-permalink-change

Conversation

@leonidasmi
Copy link
Copy Markdown
Contributor

@leonidasmi leonidasmi commented Jan 29, 2026

Context

Summary

This PR can be summarized in the following changelog entry:

  • WooCommerce introduced a new logic for permalinks in version 10.5. Since this update could result in mismatching Yoast SEO metadata (such as Schema.org data), this version of Yoast SEO temporarily restores the old behavior. Note that for users of Yoast WooCommerce SEO the new permanent link structure will apply.

Relevant technical choices:

Test instructions

Test instructions for the acceptance test before the PR gets merged

This PR can be acceptance tested by following these steps:

  • Have Woo (pre-10.5) and Yoast Free enabled
  • Have Shop base with category as the products' permalinks
  • Create the following product categories (important: with the order that I'm sharing)
    • Smartphones
    • Phones
    • Electronics
  • Edit Phones and make it a child of Electronics
  • Edit Smartphones and make it a child of Phones
  • Create 2 products that belong to all 3 categories:
    • Product A, with Phones as the primary category
    • Product B, with Smartphones as the primary category
  • Both products have a permalink of example.com/shop/electronics/phones/productName format
  • We upgrade to Woo 10.5
    Without this PR:
  • both products have had their permalinks changed to example.com/shop/electronics/phones/smartphones/productName/
  • however their meta tags/canonicals/schema URLs have stayed at the previous format
    With this PR:
  • no products have had their permalinks changed to example.com/shop/electronics/phones/smartphones/productName/
  • visit the All products page in the admin and confirm the above
  • visit the products' pages and confirm you're not redirected anywhere else
  • confirm that the meta tags and schema attributes have the URLs of the page you're on

Yoast Woo SEO implications:

  • We're gonna do the above test, but with Yoast Woo SEO enabled too. So the first steps are the same:
  • Have Woo (pre-10.5) and Yoast Free enabled and also Yoast Woo SEO enabled
  • Have Shop base with category as the products' permalinks
  • Create the following product categories (important: with the order that I'm sharing)
    • Smartphones
    • Phones
    • Electronics
  • Edit Phones and make it a child of Electronics
  • Edit Smartphones and make it a child of Phones
  • Create 3 products that belong to all 3 categories:
    • Product A, with Electronics as the primary category
    • Product B, with Phones as the primary category
    • Product C, with Smartphones as the primary category
  • Product with Electronics as primary has a permalink of example.com/shop/electronics/productName format
  • Product with Phones as primary has a permalink of example.com/shop/electronics/phones/productName format
  • Product with Smartphones as primary has a permalink of example.com/shop/electronics/phones/smartphones/productName format
  • We upgrade to Woo 10.5
  • all products keep their old permalinks 👍

Relevant test scenarios

  • Changes should be tested with the browser console open
  • Changes should be tested on different posts/pages/taxonomies/custom post types/custom taxonomies
  • Changes should be tested on different editors (Default Block/Gutenberg/Classic/Elementor/other)
  • Changes should be tested on different browsers
  • Changes should be tested on multisite

Test instructions for QA when the code is in the RC

  • QA should use the same steps as above.

Impact check

This PR affects the following parts of the plugin, which may require extra testing:

Other environments

  • This PR also affects Shopify. I have added a changelog entry starting with [shopify-seo], added test instructions for Shopify and attached the Shopify label to this PR.
  • This PR also affects Yoast SEO for Google Docs. I have added a changelog entry starting with [yoast-doc-extension], added test instructions for Yoast SEO for Google Docs and attached the Google Docs Add-on label to this PR.

Documentation

  • I have written documentation for this change. For example, comments in the Relevant technical choices, comments in the code, documentation on Confluence / shared Google Drive / Yoast developer portal, or other.

Quality assurance

  • I have tested this code to the best of my abilities.
  • During testing, I had activated all plugins that Yoast SEO provides integrations for.
  • I have added unit tests to verify the code works as intended.
  • If any part of the code is behind a feature flag, my test instructions also cover cases where the feature flag is switched off.
  • I have written this PR in accordance with my team's definition of done.
  • I have checked that the base branch is correctly set.
  • I have run grunt build:images and commited the results, if my PR introduces new images or SVGs.

Innovation

  • No innovation project is applicable for this PR.
  • This PR falls under an innovation project. I have attached the innovation label.
  • I have added my hours to the WBSO document.

Fixes #

@leonidasmi leonidasmi added changelog: other Needs to be included in the 'Other' category in the changelog fix-before-release labels Jan 29, 2026
@leonidasmi leonidasmi added this to the 26.9 milestone Jan 29, 2026
@leonidasmi leonidasmi self-assigned this Jan 29, 2026
@coveralls
Copy link
Copy Markdown

coveralls commented Jan 29, 2026

Pull Request Test Coverage Report for Build e8c9141e5293659ca6e8b39d10a54ada368b9045

Details

  • 0 of 22 (0.0%) changed or added relevant lines in 3 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.5%) to 52.814%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/conditionals/woo-seo-inactive-conditional.php 0 2 0.0%
src/conditionals/woocommerce-version-conditional.php 0 4 0.0%
src/integrations/woocommerce-product-category-permalink-integration.php 0 16 0.0%
Totals Coverage Status
Change from base Build 1b1918557dc5f022d8e57d15c12005b4d901429c: -0.5%
Covered Lines: 32307
Relevant Lines: 61243

💛 - Coveralls

@leonidasmi leonidasmi marked this pull request as ready for review January 29, 2026 11:54
@leonidasmi leonidasmi assigned thijsoo and pls78 and unassigned leonidasmi Jan 29, 2026
Copy link
Copy Markdown
Member

@pls78 pls78 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CR: ✅

Copy link
Copy Markdown
Contributor

@thijsoo thijsoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACC 👍

@thijsoo thijsoo merged commit c7fabbc into release/26.9 Jan 29, 2026
26 checks passed
@thijsoo thijsoo deleted the block/woo-permalink-change branch January 29, 2026 12:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog: other Needs to be included in the 'Other' category in the changelog fix-before-release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants