WordPress 404 Errors on French Translated Pages with Rank Math Short URLs

#1023526
  • Resolved Olga
    Rank Math free

    Hello,

    I’m encountering 404 errors on French translated pages when using TranslatePress with specific settings on my WordPress site. The 404 pages are rendered by WordPress (using my theme’s 404.php template), not Apache. Here’s the setup and issue:

    Setup:

    Product permalinks Product permalinks – Custom base /product/

    Languages: English (default, in subdirectory /en/) and French (/fr/)

    Hosting: SiteGround

    Plugins: TranslatePress (with “Force language in custom links” and “Add Subdirectory to Default Language” enabled) and Rank Math SEO

    Issue:

    When I enable Remove Category Base and Remove Parent Slugs in Rank Math to shorten URLs (e.g., from example.com/category/postname to example.com/postname), French translated pages (e.g., example.com/fr/postname) return a WordPress 404 error (with my theme’s design).

    Disabling these Rank Math options eliminates the 404 errors, but I want to keep the shortened URLs.

    Non-translated pages (e.g., example.com/category/postname) work perfectly with or without these options.

    Steps Tried:

    Updated .htaccess to ensure language prefixes are handled:

    RewriteCond %{REQUEST_URI} ^/([a-zA-Z]{2,3}(-[a-zA-Z]{2})?)/(.*)$ [NC]
    RewriteRule ^([a-zA-Z]{2,3}(-[a-zA-Z]{2})?)/(.*)$ index.php?lang=$1&$3 [L,QSA]

    This had no effect, likely because the 404 is from WordPress, not Apache.

    Reset permalinks multiple times.

    Cleared SiteGround’s and Cloudflare’s cache after every change.

    Checked TranslatePress settings: languages are correctly set, and translations for affected pages exist.

    Disabling Rank Math’s Remove Category Base and Remove Parent Slugs resolves the issue, but I lose short URLs.

    Request: Could you advise on how to resolve the WordPress 404 errors on French translated pages while keeping Rank Math’s short URL options enabled? Is there a specific TranslatePress setting, filter, or workaround to ensure compatibility with Rank Math’s Remove Category Base and Remove Parent Slugs? Would switching the permalink structure to /%postname%/ resolve the conflict?

    Thank you for help!

    Best regards,

    Olga

Viewing 1 replies (of 1 total)
  • Hello,

    Thank you for your query and we are so sorry about the trouble this must have caused.

    The issue you’re facing is due to a known incompatibility between TranslatePress and Rank Math’s “Remove Category Base” and “Remove Parent Slugs” options. These features conflict with how TranslatePress handles translated slugs, especially when language subdirectories are used.

    Unfortunately, TranslatePress doesn’t currently support this structure. At this time, the best workaround is to keep those two options disabled to avoid 404s.

    We’ve logged this on our end and plan to reach out to the TranslatePress team for a long-term fix. Switching to /%postname%/ won’t resolve the issue since the problem lies in translated taxonomy slugs, not the permalink structure.

    Don’t hesitate to get in touch with us if you have any other questions.

    Hello,

    Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.

    If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.

    Thank you.

Viewing 1 replies (of 1 total)

The ticket ‘WordPress 404 Errors on French Translated Pages with Rank Math Short URLs’ is closed to new replies.