Skip to content Skip to sidebar

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 18:00 9:00 – 18:00 9:00 – 18:00 9:00 – 18:00 9:00 – 18:00 -
- - - - - - -

Supporter timezone: Asia/Karachi (GMT+05:00)

Tagged: 

This topic contains 7 replies, has 1 voice.

Last updated by Waqas Bin Hasan 5 days, 6 hours ago.

Assisted by: Waqas Bin Hasan.

Author Posts
August 28, 2025 at 9:31 am #17354090

junichiroH

Background of the issue:
I am trying to build and manage a multilingual travel and culture blog using WPML. The site I need help with is hidden link. I have checked the official WPML documentation, but I could not find any explanation for these errors.

Symptoms:
After installing and using WPML, the number of errors on my site has been increasing. Every time I publish a new blog post, new errors appear, including 404 errors, redirect errors, and duplicate/canonical issues.

Questions:
What is causing the increase in errors after publishing new content?
How can I fix the 404 errors, redirect errors, and duplicate/canonical issues?

August 29, 2025 at 9:55 am #17357599

junichiroH

Hello, thank you for your guidance so far. Unfortunately, the issues on my site are still not resolved, and the errors continue to increase. I would greatly appreciate if this case could be escalated to a support engineer for direct assistance. The problems are complex and very specific to my setup, so I believe a human specialist would be best able to help me.

August 29, 2025 at 5:22 pm #17358574

junichiroH

I can’t seem to find the “Switch to Human Support” button. Could you please tell me where it is?

August 30, 2025 at 5:41 pm #17359790

Andrey
WPML Supporter since 06/2013

Languages: English (English ) Russian (Русский )

Timezone: Europe/Kyiv (GMT+03:00)

While one of my teammates is working on your ticket, I will give you some initial debugging steps.

You've already switched to human support, and a support ticket has been created.

To assist you more effectively, could you please provide a detailed description of the issue?

Are there any specific errors visible on the site that you can share as examples? If you temporarily disable WPML, do you still see any errors?

September 2, 2025 at 2:53 am #17364210

junichiroH

I have tried several approaches, but unfortunately I haven’t been able to resolve the issue. At the moment, I am using custom rules in the .htaccess file to try to avoid the errors, and I am monitoring the situation. However, this feels more like a temporary workaround than a fundamental solution.
To answer your questions:
The errors (404 pages, redirect loops, and duplicate/canonical issues) mainly appear right after I publish new blog posts.
If I temporarily disable WPML, these errors do not appear. This makes me think they are directly related to WPML’s multilingual handling.
For now, I am relying on .htaccess adjustments, but I would prefer a proper fix within WPML or configuration guidance.
Here is the current version of my .htaccess file, which I am using to manage redirects, canonicalization, and indexing issues. At the moment, it helps reduce errors in Google Search Console, but I am not sure if any of these rules might conflict with WPML’s multilingual functionality.
Could you please review the code and let me know if there are any parts that could cause problems with WPML (redirects, language handling, or canonical issues)?

# =========================================
# .htaccess — Complete Version (with trailing slash enforcement / Apache 2.4.62)
# Purpose: Reduce GSC duplicates/redirects (always single-hop)
# Policy: HTTPS & non-www canonicalization → Double-slash normalization → Abnormal URL recovery
# → Preserve (real files/admin/REST/robots) → Rank Math Sitemap
# → Trailing slash unification & language root/index.php normalization
# → blog/event unification (multilingual/case-insensitive) → Disable author archives
# → Targeted 410 (Japanese mix/spam URLs) → noindex enforcement (search/reply/preview/feed/tracking QS)
# → WordPress default
# =========================================

Options -MultiViews

<IfModule mod_rewrite.c>
RewriteEngine On

# --- 0) HTTPS & non-www canonicalization (highest priority, always single-hop) ---
RewriteCond %{HTTPS} !=on [OR]
RewriteCond %{HTTP_HOST} ^www\.lifeontheplanetladakh\.com$ [NC]
RewriteRule ^ hidden link{REQUEST_URI} [R=301,END]

# --- 0b) Double-slash normalization (// → / in one hop) ---
RewriteCond %{THE_REQUEST} "\s//+" [OR]
RewriteCond %{REQUEST_URI} "^//+"
RewriteRule ^(.*)$ hidden link [R=301,END]

# --- 1) Abnormal URL (/hidden link...) redirect to homepage ---
RewriteCond %{REQUEST_URI} ^/https?://lifeontheplanetladakh\.com/?$ [NC,OR]
RewriteCond %{REQUEST_URI} ^/https?%3A%2F%2Flifeontheplanetladakh\.com/?$ [NC,OR]
RewriteCond %{REQUEST_URI} ^/https?:/+ [NC]
RewriteRule ^ hidden link [R=301,END]

# --- 2) Preserve after canonicalization (real files, admin, REST, robots) ---
# Preserve real files and directories
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule . - [END]

# Admin panel & login
RewriteRule ^wp-admin/ - [END]
RewriteRule ^wp-login\.php$ - [END]

# REST API → internal pass (stable 200)
RewriteRule ^wp-json/ index.php [END]

# robots.txt pass-through
RewriteRule ^robots\.txt$ - [END]

# --- Rank Math Sitemap (handed to index.php here) ---
# (Important) Unify Rank Math as the official sitemap
RewriteRule ^sitemap_index\.xml$ /index.php?sitemap=1 [L]
RewriteRule ^([^/]+?)-sitemap([0-9]+)?\.xml$ /index.php?sitemap=$1&sitemap_n=$2 [L]
RewriteRule ^([a-z]+)?-?sitemap\.xsl$ /index.php?xsl=$1 [L]

# WordPress default wp-sitemap.* → Rank Math sitemap (301 single-hop, avoid duplicates)
RewriteRule ^wp-sitemap\.xml$ /sitemap_index.xml [R=301,END]
RewriteRule ^wp-sitemap-.*\.xml$ /sitemap_index.xml [R=301,END]

# --- 2b) Trailing slash unification (no extension → / in one hop) ---
# Exclude: real files/directories, admin/REST/robots/sitemap/with extension
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !\.[a-z0-9]{2,5}$ [NC]
RewriteCond %{REQUEST_URI} !^/wp-(admin|login\.php|json)/? [NC]
RewriteCond %{REQUEST_URI} !^/(robots\.txt|sitemap(_index)?\.xml|wp-sitemap\.xml|news-sitemap\.xml)$ [NC]
RewriteCond %{REQUEST_URI} !^/.+-sitemap[0-9]*\.xml$ [NC] # Exclude Rank Math individual sub-sitemaps
RewriteRule ^(.+?[^/])$ hidden link [R=301,END]

# Add trailing slash for language root (/de → /de/)
RewriteRule ^([a-z]{2})$ hidden link [R=301,END]

# Normalize exposed index.php
RewriteRule ^index\.php/?$ hidden link [R=301,END]
RewriteRule ^index\.php/(.+)$ hidden link [R=301,END]

# --- 3) BLOG / EVENT slug unification (multilingual, case-insensitive) ---
RewriteRule ^blog-en/?$ blog/ [R=301,END,NC]
RewriteRule ^blog-en/(.+?)/?$ blog/$1/ [R=301,END,NC]

RewriteRule ^de/(blog-de|blogs-de)/?$ de/blog/ [R=301,END,NC]
RewriteRule ^de/(blog-de|blogs-de)/(.+?)/?$ de/blog/$2/ [R=301,END,NC]
RewriteRule ^fr/(blog-fr|blogs-fr)/?$ fr/blog/ [R=301,END,NC]
RewriteRule ^fr/(blog-fr|blogs-fr)/(.+?)/?$ fr/blog/$2/ [R=301,END,NC]
RewriteRule ^es/(blog-es|blogs-es)/?$ es/blog/ [R=301,END,NC]
RewriteRule ^es/(blog-es|blogs-es)/(.+?)/?$ es/blog/$2/ [R=301,END,NC]
RewriteRule ^it/(blog-it|blogs-it)/?$ it/blog/ [R=301,END,NC]
RewriteRule ^it/(blog-it|blogs-it)/(.+?)/?$ it/blog/$2/ [R=301,END,NC]
RewriteRule ^ja/(blog-ja|blogs-ja)/?$ ja/blog/ [R=301,END,NC]
RewriteRule ^ja/(blog-ja|blogs-ja)/(.+?)/?$ ja/blog/$2/ [R=301,END,NC]

RewriteRule ^events/?$ event/ [R=301,END,NC]
RewriteRule ^events/(.+?)/?$ event/$1/ [R=301,END,NC]
RewriteRule ^de/events/?$ de/event/ [R=301,END,NC]
RewriteRule ^de/events/(.+?)/?$ de/event/$1/ [R=301,END,NC]
RewriteRule ^fr/events/?$ fr/event/ [R=301,END,NC]
RewriteRule ^fr/events/(.+?)/?$ fr/event/$1/ [R=301,END,NC]
RewriteRule ^es/events/?$ es/event/ [R=301,END,NC]
RewriteRule ^es/events/(.+?)/?$ es/event/$1/ [R=301,END,NC]
RewriteRule ^it/events/?$ it/event/ [R=301,END,NC]
RewriteRule ^it/events/(.+?)/?$ it/event/$1/ [R=301,END,NC]
RewriteRule ^ja/events/?$ ja/event/ [R=301,END,NC]
RewriteRule ^ja/events/(.+?)/?$ ja/event/$1/ [R=301,END,NC]

# --- 4) Disable AUTHOR archives (all languages) ---
RewriteRule ^(?:[a-z]{2}/)?author/ / [R=301,END,NC]

# --- 5) Targeted 410 (remove unwanted URLs) ---
# Variants ending with -jp
RewriteRule .*-jp/?$ - [G,END]
# Japanese percent-encoded characters mixed under multilingual (e.g. %E3-%E9) + common spam encoding
RewriteRule ^(?:fr|de|it|es)/(.*%E3%.*|.*%E4%.*|.*%E5%.*|.*%E6%.*|.*%E7%.*|.*%E8%.*|.*%E9%.*|.*%20.*|.*%2F.*)$ - [G,NC,END]

</IfModule>

# --- 6) noindex (search/reply/preview/feed/tracking QS) ---
<IfModule mod_headers.c>
# HSTS (⚠ Be careful with duplication if also set in Cloudflare, etc.)
Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"

# Login must be noindex
<FilesMatch "^wp-login\.php$">
Header set X-Robots-Tag "noindex, nofollow, noarchive, nosnippet"
</FilesMatch>

# Add X-Robots-Tag based on environment variable
Header set X-Robots-Tag "noindex, nofollow" env=do_noindex
Header set X-Robots-Tag "noindex, follow" env=do_noindex_feed
</IfModule>

<IfModule mod_rewrite.c>
# 6a) Search results / reply / preview / attachment ID
RewriteCond %{QUERY_STRING} (^|&)s= [NC,OR]
RewriteCond %{QUERY_STRING} (^|&)replytocom= [NC,OR]
RewriteCond %{QUERY_STRING} (^|&)preview(=|&|$) [NC,OR]
RewriteCond %{QUERY_STRING} (^|&)attachment_id=\d+ [NC]
RewriteRule ^ - [E=Q_NOINDEX:1,E=do_noindex:1,END]

# 6a-2) Path-based search (/search/…)
RewriteCond %{REQUEST_URI} ^search/ [NC,OR]
RewriteCond %{REQUEST_URI} ^[a-z]{2}/search/ [NC]
RewriteRule ^ - [E=Q_NOINDEX:1,E=do_noindex:1,END]

# 6a-3) Path-based search feeds (/search/.../feed/)
RewriteCond %{REQUEST_URI} ^search/.+/feed/?$ [NC,OR]
RewriteCond %{REQUEST_URI} ^[a-z]{2}/search/.+/feed/?$ [NC]
RewriteRule ^ - [E=do_noindex_feed:1,END]

# 6b) feed (path suffix / query string)
RewriteCond %{REQUEST_URI} (^|/)feed/?$ [NC,OR]
RewriteCond %{QUERY_STRING} (^|&)feed=(rss|rss2|rdf|atom) [NC]
RewriteRule ^ - [E=do_noindex_feed:1,END]

# 6c) Tracking query strings (noindex)
RewriteCond %{QUERY_STRING} (^|&)(utm_[^&]+) [NC,OR]
RewriteCond %{QUERY_STRING} (^|&)(fbclid|gclid|msclkid|mc_cid|mc_eid|epik|_hsenc|vero_id|twclid|igshid) [NC]
RewriteRule ^ - [E=Q_NOINDEX:1,E=do_noindex:1,END]
</IfModule>

# Extra safeguard: ensure feeds are noindex by file pattern
<IfModule mod_headers.c>
<FilesMatch "(^|/)(feed|rss|rss2|rdf|atom)(\.xml)?$">
Header set X-Robots-Tag "noindex, follow"
</FilesMatch>
</IfModule>

# --- 7) WordPress Default ---
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

September 2, 2025 at 7:57 am #17364659

Waqas Bin Hasan
WPML Supporter since 05/2014

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi,

Thank you for contacting the support. I'm assigned this ticket and 'll try my best to help you on the matter.

First of all, please note that your .htaccess file contains a lot of stuff probably from several plugins managing redirections and the related stuff. This may cause conflicts.

So before proceeding further, can you please try the following?

Take a full backup of your site and database before proceeding. It is highly advised to try these on a dev or staging site first, so your live site isn't compromised.

1) Enable debugging in your site. See https://wpml.org/documentation/support/debugging-wpml/ for details. Once enabled, this will log the errors in the debug.log file which you can upload somewhere  (i.e. hidden link) and share the download link for investigation.
2) Deactivate all plugins except WPML and String Translation.
3) Switch to a standard theme like 2024 or 2021.
4) Rename your .htaccess file to something else (i.e. 1.htaccess). Then go to WordPress Dashboard -> Permalinks -> save without making any change. So it generates default WordPress .htaccess.
5) Check for the issue if it still happens.
6) Then start activating plugins one by one while keep checking for the issue. This way you 'll be able to pinpoint a conflict when & where it starts creating the problem.
7) If after activating all plugins you see that it still works fine, then switch to your theme and see if that's causing it.

Please let me know your findings and I'll try my best to help you further.

Regards.

September 4, 2025 at 11:27 am #17375155

junichiroH

Hello WPML Support,
I have carefully followed all the troubleshooting steps you provided.
Here is a detailed report of what has been done and the current results:
1. Language URL Format
Checked at WPML > Languages > Language URL format.
Confirmed setting: “Different languages in directories” is active.
Default language (English) shows without directory (/blog/…).
“Hide URL language information for default language” is ON.
✅ Confirmed correct.
2. Browser Language Redirect
Verified at WPML > Languages > Browser language redirect.
Set to Off to avoid SEO conflicts.
✅ Confirmed Off.
3. Menu Synchronization
Ran synchronization via WPML > WP Menus Sync.
No pending changes were found.
Applied sync to confirm — all menus are aligned across languages.
✅ Completed.
4. Slug & Taxonomy Translation
Checked WPML > Taxonomy translation.
All category and tag slugs have translations filled in.
Verified at WPML > Settings > Post Types & Taxonomies Translation → posts, categories, tags are set to Translatable.
✅ Completed.
5. String Translation (Theme/Plugins)
Performed scan with +Domain selection → Scan theme/plugins for strings.
Detected strings were reviewed.
Important UI strings (Rank Math labels, Contact Form messages, button texts) are translated and consistent.
✅ Completed.
6. Hreflang for Key Pages
Verified Home, Blog, About, Contact pages in all languages.
Each page shows the correct translation link status (pencil icon).
Cross-linking confirmed: e.g. English Home ↔ French Accueil ↔ German Startseite, etc.
✅ Completed.
7. Sitemap & Indexing
Checked Rank Math > Sitemap settings.
Posts, Pages, and Categories in all languages appear correctly in the sitemap.
/hi/ staging directory is set to noindex and excluded from sitemap.
Submitted sitemap in GSC → no errors reported, status 200 OK for all language URLs.
✅ Completed.
8. Cache / CDN
Cleared WordPress cache, server cache, and Cloudflare cache after updates.
Tested representative URLs on httpstatus.io → all returned 200 OK with zero redirects.
✅ Completed.
9. Theme Test / Restore
Confirmed production theme is active.
Meta tags and hreflang remain correct.
✅ Completed.
10. Forms Testing
Tested Contact forms in all languages (CF7).
Submissions successful, messages correctly localized (EN, FR, DE, IT, JA, ES).
reCAPTCHA site/secret keys are consistent with production environment.
✅ Completed.
✅ Final Result
All WPML troubleshooting steps have been completed successfully.
At present:
URLs in all languages return 200 OK.
Hreflang tags are consistent.
Sitemaps are correct and indexed.
No remaining issues found.

Additional Note for Support:
We will now monitor Google Search Console for the next few days to confirm that index coverage remains stable and that no new issues appear.

September 4, 2025 at 12:35 pm #17375575

Waqas Bin Hasan
WPML Supporter since 05/2014

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for the updates, glad that it worked out for you.

Sure please take your time and feel free to reply when ready.