You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've searched for any related issues and avoided creating a duplicate issue.
Please give us a description of what happened.
Client's website randomly stopped showing products on the product archive page. Eventually we found that rewrite_rules are sometimes broken and don't contain post_type=product in the main WP query.
Please describe what you expected to happen and why.
We expected products to not randomly stop showing.
How can we reproduce this behavior?
Assume a WPML language-per-domain setup:
English -> example.eu (default domain)
Latvian -> example.lv
Lithuanian -> example.lt
save permalinks via WP settings (this resets to a known good state)
edit "wpseo" option via DB, change "home_url" value to example.lv (non-default language domain)
invoke "wpseo_permalink_structure_check" cron task via a cron manager
quickly open example.lt (a different non-default language domain)
open product page in the default language domain (example.eu). All products are missing.
Technical info
The problem is caused by the Indexable_HomeUrl_Watcher class, which deletes rewrite_rules option upon detecting that the home URL has changed. WPML domain-per-language feature causes get_home_url() to return a different value for each language.
WordPress will automatically regenerate rewrite_rules from the frontend upon the next visit. If that visit is from a non-default language domain, the generated permalinks will not contain rules for all languages.
At most, Yoast should show a notification that permalinks should be re-saved.
Used versions
WordPress version: 6.0
Yoast SEO version: 19.1
Woocommerce: 6.4.1
The text was updated successfully, but these errors were encountered:
Please give us a description of what happened.
Client's website randomly stopped showing products on the product archive page. Eventually we found that rewrite_rules are sometimes broken and don't contain
post_type=product
in the main WP query.Please describe what you expected to happen and why.
We expected products to not randomly stop showing.
How can we reproduce this behavior?
Assume a WPML language-per-domain setup:
English -> example.eu (default domain)
Latvian -> example.lv
Lithuanian -> example.lt
Technical info
The problem is caused by the
Indexable_HomeUrl_Watcher
class, which deletesrewrite_rules
option upon detecting that the home URL has changed. WPML domain-per-language feature causes get_home_url() to return a different value for each language.WordPress will automatically regenerate rewrite_rules from the frontend upon the next visit. If that visit is from a non-default language domain, the generated permalinks will not contain rules for all languages.
At most, Yoast should show a notification that permalinks should be re-saved.
Used versions
The text was updated successfully, but these errors were encountered: