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.

Our next available supporter will start replying to tickets in about 1.20 hours from now. Thank you for your understanding.

This topic contains 38 replies, has 8 voices.

Last updated by ivanR-11 6 months, 2 weeks ago.

Assigned support staff: Bruno Kos.

Author Posts
February 8, 2019 at 11:09 pm #3177290

yuryS-4

I am trying to: load a category archive page

Link to a page where the issue can be seen: hidden link

I expected to see: The category archive page.

Instead, I got: 404 page not found

More detail: There is an issue with the latest version of WPML Multilingual CMS 4.2.0 - When loading a category, a 404 page is displayed.

Testing: I tested with the previous version of WPML Multilingual CMS 4.1.4 and there are no issues. I also disabled all other plugins while testing (including Yoast which normally strips the "Category" base).

I tried setting the category base to a ".", but the issue remains (screenshot attached).

To me it appears to be a bug in the latest version.

February 11, 2019 at 12:49 pm #3182893

Bruno Kos
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hi,

Thank you for contacting WPML support!

So not a single category works, like hidden link also?

Can you please check if this issue appears when:

- only WPML plugins are activated, as it will tell us if there is an interaction issue with other plugin
- theme is set to a WordPress default like Twenty Seventeen as it will tell us if there is an interaction issue with your theme

Another thing - based on the image, I can see that you are using WP Engine. Does it work on their staging site, given that there is no caching there?

Can you also try the following:
- clear the cache (server and site cache)
- clear WPML cache in WPML -> Support -> Troubleshooting
- resave permalinks (but this has already been done from what I gather)

Please make a full backup of your site before trying this or make these changes on a staging/development site!

You can use plugins such as Duplicator ( https://wordpress.org/plugins/duplicator/) or UpdraftPlus WordPress Backup Plugin (https://wordpress.org/plugins/updraftplus/) or ask your host to perform a site backup.

Regards,
Bruno Kos

February 11, 2019 at 4:06 pm #3184009

yuryS-4

Hi Bruno,

I've done some extensive testing - here are the results.

NOT WORKING - hidden link
WORKING - hidden link

*Top level/base categories appear to work still -> sub categories are broken*

    Twenty seventeen theme + WPML plugins only + Yoast to "strip" the category slug. Tested on WPEngine staging site.

WPML Multilingual CMS 4.1.0 -> Works, no issues
WPML Multilingual CMS 4.1.4 -> Works, no issues
WPML Multilingual CMS 4.2.0 -> 404 on sub category slugs

Also tested by resetting WPML config fully - still the same problem on the latest version.

February 11, 2019 at 4:39 pm #3184359

yuryS-4

**EDIT**

Just did some testing on a separate fresh website i've been developing -> issue is exactly the same. Whenever i'm stripping the category base, the category archive page will 404.

Also tried removing Yoast and doing a HTACCESS redirect. Same issue.
RewriteRule ^category/(.+)$ hidden link [R=301,L]

Based on all the testing, you should be able to replicate the same in a fresh env.

February 12, 2019 at 8:55 am #3187360

Bruno Kos
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hi,

Thank you for all the testing!

However, is this WPML or WordPress bug? I am not totally sure. I see this issue with WPML deactivated also and did this on a fresh installation. I even didn't strip category base. Can you check my next private message for the logins and try for yourself?

Example:
hidden link
hidden link - 404
hidden link - working

Feel free to do whatever you want inside this sandbox, including wiping all the plugins and resetting WPML.

Regards,
Bruno Kos

February 12, 2019 at 4:00 pm #3189668

yuryS-4

Hi Bruno,

For sure not a wordpress bug -> This would be a major issue if it were.

I will run through the testing I just did from first to last steps.

1. Checked "/cat2/cat22" -> 404 (same thing you saw)
2. re-saved Permalinks -> Checked "/cat2/cat22" -> WORKED
3. Set the category base to "." like in my first screenshot.
4. Enabled WPML + re-saved Permalinks -> Checked "/cat2/cat22" -> 404
5. Installed YoastSEO and set it to strip the category base.
6. re-saved Permalinks -> Checked "/cat2/cat22" -> 404
7. Deactivated YoastSEO.
8. Installed a different plugin "Remove Category URL (1.1.2)"
9. re-saved Permalinks -> Checked "/cat2/cat22" -> WORKED

My conclusion with the testing is as follows.

- With only WPML installed (no other plugins), if the category base is set to ".", sub categories will 404.
- With WPML + Yoast installed to strip the category base, sub categories will 404.
- With WPML + Remove Category URL (1.1.2), sub categories will work as expected and the category base is stripped.

Appears that there is a conflict with YoastSEO and WPML 4.2.0 -> I tested with WPML 4.1.4 and there were no issues. This issue appears to have been introduced in the latest update of WPML.

February 13, 2019 at 8:16 am #3192457

Bruno Kos
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hi,

How did you get hidden link working?

I am trying:

2. re-saved Permalinks -> Checked "/cat2/cat22" -> WORKED

And removed "." from Category base, however it would not work.

Is 2) working before WPML initial setup was done?

Regards,
Bruno Kos

February 14, 2019 at 4:59 pm #3201069

yuryS-4

Hi Bruno,

Wordpress default behavior is to include the category URL. I think I made a mistake in my last wording -> A plugin like "YoastSEO", "Remove Category URL" or similar is required to strip the category base.

The problem remains - Why do the category pages 404 when Yoast SEO + WPML latest is activated (with it set to strip the category base enabled) ?

As a work around, I've disabled YoastSEO on my site and i'm using "Remove Category URL" plugin as there does not appear to be any conflict with WPML.

(looking around on other forums, other people are seeing the same issue with the latest version of WPML)
https://wordpress.org/support/topic/getting-404-with-sub-category/

February 15, 2019 at 8:38 am #3203455

Bruno Kos
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hi,

Can you tell me this workaround works with the latest version (4.2.1)?

https://wpml.org/errata/yoast-seo-strip-the-category-base-does-not-work-in-the-second-language/

Disable that option in Yoast SEO plugin and use this plugin instead https://wordpress.org/plugins/no-category-base-wpml/

Please try on and let me know how it goes:
hidden link

Regards,
Bruno Kos

February 16, 2019 at 2:43 pm #3207886

richardP-23

Hi!

We are experiencing the exact same issue with our website, after updating to the latest version of all WPML plugins. We use Yoast SEO, as well, and the plugin "No category base WPML".

From our investigation so far, we've discovered that the sub-categories do start to work with the plugin "No category base WPML" active and the setting "Remove the categories prefix" in Yoast set to "Remove". However, this leads to an infinite redirect loop on the translated categories: /fr/cat-fr/subcat-fr/ redirects to /cat-fr/subcat-fr/ and then the same redirect keeps being returned.

Our workaround, at the moment, if the 404s on the sub-categories occur, is to disable the WPML plugins, flush the permalinks and then re-enable the WPML plugins. The 404s go away until the permalinks get refreshed once again (e.g. after editing a category).

Is there a WPML fix in work, for this issue?

Thanks!
Marius

February 18, 2019 at 10:04 pm #3214236

yuryS-4

Hi Bruno,

Same issue when the YoastSEO option is disabled and trying to use the no-category-base-wpml plugin.

Right now my only work around is to disable YoastSEO, which is not ideal and not a long term solution.

Is WPML working on a fix for this bug?

February 19, 2019 at 10:28 am #3216019

Bruno Kos
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hi All,

Our workaround, at the moment, if the 404s on the sub-categories occur, is to disable the WPML plugins, flush the permalinks and then re-enable the WPML plugins. The 404s go away until the permalinks get refreshed once again (e.g. after editing a category).

This workaround indeed works with Yoast SEO activated. Otherwise, as you've all noted, subcategories will return 404. I've tested this workaround and it works with Yoast SEO being active:
hidden link
hidden link

However, this topic has been escalated within out internal debugging system and I will keep you updated with any new useful information!

Regards,
Bruno Kos

February 19, 2019 at 10:48 am #3216158

Marvin

Hello,

I have exactly the same issue and found the same "solution".
WPML support came with the same solution on the chat, but it issnt a stable/usable one.

Bruno, how long do you think it will take until this bug is fixed? Because I'm having a client with 404 pages on a live website.

February 19, 2019 at 1:39 pm #3216871

Bruno Kos
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hi,

Bruno, how long do you think it will take until this bug is fixed? Because I'm having a client with 404 pages on a live website.

Hopefully the workaround will also work on your clients' site. As for fixing it, I can't give you any dates, not even close. It could end up in the next release or in 6 months. This is totally up to developers - severity of the issue and number of reported cases (among other things) decide its queue in the list.

Also, if we have multiple plugins involved (such as Yoast here), it may (or not) also require cooperation with their developers,

Regards,
Bruno Kos

February 19, 2019 at 3:18 pm #3217528

leonB-2

Hi,

I'm been struggling with the exact same problem, so I'm tagging along for the ride, waiting for a solution. (I'm also using the WPML, Yoast and the Remove Category URL plugins.)

Also: For me, the temporary fix already works by
• after creating a new post, add or remove a dummy category. Empty categories are not displayed so just create one OR delete the dummy category from last time, either will flush the cache. I also always load a category page to see if it works or not.. not sure if this is necessary.
• disable Remove Category URL and all WPML plugins again (bulk action is faster, no need for doing it one-by-one). Check again. No change.
• enable them again and check if the category works again.