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.

This topic contains 20 replies, has 3 voices.

Last updated by Ahmed Ibrahim 1 year, 5 months ago.

Assigned support staff: Ahmed Ibrahim.

Author Posts
April 25, 2018 at 7:45 pm #1818717

Kim Gamez

I have an issue with my install. The translated blog categories were 404ing because I had Yoast SEO removing the /category/ from the url. I have disabled that and installed the suggested plugin I found in another thread. All seems to work except now the /shop/ page is empty. I have had this issue before so I resaved my woocommerce setting and the shop is back but the translated blog categories are back to 404ing. The shop is more important at the moment so I am leaving it as is but would love if someone could help me get to the bottom of the issue.

April 27, 2018 at 2:25 pm #1862665

Lauren
Supporter

Languages: English (English )

Timezone: America/New_York (GMT-04:00)

Thank you for contacting WPML support. I'll be happy to help you with this.

Please go to Settings -> Permalinks. Here, do you have the shop page slug and blog permalinks set correctly? If so, please resave the permalinks and let me know if this resolves the issue. Also, go to the shop page and check the URL on the page. Then update the page, and see if this works correctly now.

If that does not resolve the issue, I'd like to have you try a few things so we can try to isolate the issue. This is just to help me identify if it might be a conflict with another plugin or theme that is causing the problem.

** IMPORTANT ** Please backup a working copy of site files and database before continuing.

Update all WPML plugins & WordPress core.

Disable all plugins except WPML related and then temporarily change the theme to a default WordPress such as TwentyFifteen. With these settings, is the issue resolved?

April 27, 2018 at 6:46 pm #1867633

Kim Gamez

Lauren,

I have flushed the permalinks many times. When I do the translated(Spanish) blog category links work but the shop disappears in the default (English) language. When I visit and resave the shop page the shop comes back and the Spanish blog posts work for a few minutes (I think they are cached by the server ) but eventually return to 404s. I have attached screenshots of the permalink setup (both are standard nothing fancy). I can spin up a staging envirorment and deactivate all of the plugins that are not specific to WPML and the core WooCommerce and see what happens. I will keep you posted.

April 27, 2018 at 7:30 pm #1868073

Lauren
Supporter

Languages: English (English )

Timezone: America/New_York (GMT-04:00)

Thanks for testing this for me. Let me know the results of testing with the minimal settings, and I'll continue to troubleshoot from there.

April 28, 2018 at 5:01 pm #1877129

Kim Gamez

I was able to figure out it was a conflict with the plugin "redirection". If I disable the redirection plugin and flush the permalinks things work as they should. I reactivated the redirection plugin and things continued to work as they should until a url that had a redirect set was hit and redirected. Once that happens the translated categories go back to 404s.

The server we are on runs on NGINX and we have to have the server support add redirects on the server level so I was really hoping to be able to use a plugin to add redirects so we dont have to email them in. We recently launched a new site and many of the urls have changed and we will likely have a handful of redirects.

I have noticed other support threads that mention issues with the redirection plugin and one had a support reply that said they were reaching out to the author of the plugin to try and get things sorted out. That was 5 years ago so I was wondering what ever came from that. It would be great if WPML had a redirect compatiable plugin as I am sure we are no the first site to need the ability to add 301 redirects. The only compatible plugin on the list does a complete 404 redirect to the homepage and then after the 404s are logged you can add a hardcoded url to redirect the url. I am not a fan of the global redirect and the fact that I can not add redirects prior to them 404ing.

Is having the server admin add the redirects the only way around this issue?

April 30, 2018 at 1:23 pm #1898019

Lauren
Supporter

Languages: English (English )

Timezone: America/New_York (GMT-04:00)

As of right now, we still are not compatible with the Redirection plugin. There are a number of redirection plugins available that may work, it is just that the others have not been through the compatibility testing with our team to get them added to our Plugin Compatibility list. So I would recommend trying some others in hopes that they will work without issue, or otherwise continue with the server admin redirects.

I wish I had a plugin to suggest that I knew was perfectly compatible, but unfortunately as of right now I don't. Please let me know if you need any further assistance and I will be happy to help.

April 30, 2018 at 6:33 pm #1903189

Kim Gamez

I have removed the redirection plugin I thought was causing the issue and I am still experincing the issue. When flushing the permalinks the translated categories show up but for some reason after some time they return to 404s. What could be causing the issue. Is there a way to flush any sort of permalink cache inside WMPL and why after a unknown amount of time would they revert back to 404s.

April 30, 2018 at 8:45 pm #1905207

Lauren
Supporter

Languages: English (English )

Timezone: America/New_York (GMT-04:00)

I recommend checking the .htaccess file to see if there are redirect rules added there from that plugin. Sometimes plugins add rewrites directly to the .htaccess file. Also, try changing to the URL format (different directories per language, language as parameters, etc) and see if the behavior is any different. You can change this setting at WPML -> Languages -> URL format.

If you don't find anything there, I'll be happy to take a deeper look. To best troubleshoot the issue, please make a snapshot of your site using the Duplicator plugin: https://wordpress.org/plugins/duplicator/. This will allow me to try and duplicate the error so that I can run further tests without interrupting your live site.

Once the snapshot is complete, either upload the snapshot ZIP file and the installer.php file to a file sharing service such as Dropbox (and share the link in your reply) or right click the Duplicator links in your wp-admin and paste in your reply.

Please note: It is important to reduce the size of the package so please exclude some paths like /cache or /uploads and also exclude archives and media files.

I will also need the username and password of an account that was created BEFORE creating the duplicator package.

I will enable the next reply to be private so only you and I have access to it!

May 1, 2018 at 3:09 pm #1914378

Lauren
Supporter

Languages: English (English )

Timezone: America/New_York (GMT-04:00)

Thanks for sending duplicator files. I was able to set up a copy of your site but I was unable to replicate the issue with minimal settings (default theme and non WPML plugins deactivated). You mentioned that you deactivated the plugins, did you also test with a default theme?

Also, I see that the category page URLs do not include the category slug. How are you removing the slug from the URL? For example, typically the slug would be hidden link and yours is formatted like hidden link

This could be what is causing the 404 pages. Please let me know if you are using a plugin or something in the code to strip the category slug, and also if the behavior is different when using a default theme.

May 1, 2018 at 5:41 pm #1916158

Kim Gamez

As I mentioned in the beginning of the thread I was originally using the Yoast to strip out the /category/ and then found this https://wpml.org/errata/yoast-seo-strip-the-category-base-does-not-work-in-the-second-language/ and switched to the workaround plugin mentioned. Can you try and see if with the default theme and that plugin activated is what is causing the problem? I am really at a loss here and would like to keep the /category/ removed from the taxonomy archives if at all possible.

May 1, 2018 at 8:02 pm #1917370

Lauren
Supporter

Languages: English (English )

Timezone: America/New_York (GMT-04:00)

Yes, the shop link and the category links both work for me with the category plugin, default theme and WPML plugins activated. I also then reactivated your current theme and that worked without issues for me as well.

Can you please ask your hosting provider to check and see if there are any errors in the server logs? Is there any chance you could setup a staging site in the same environment, so I can try to troubleshoot in an environment where I am able to reproduce the issue?

May 2, 2018 at 2:16 am #1919645

Kim Gamez

I have a staging environment set up if you can make the next response private Ill send over the details.

May 2, 2018 at 1:00 pm #1932236

Lauren
Supporter

Languages: English (English )

Timezone: America/New_York (GMT-04:00)

Thanks for setting up a staging environment. The next field is marked as private.

May 2, 2018 at 8:21 pm #1943085

Lauren
Supporter

Languages: English (English )

Timezone: America/New_York (GMT-04:00)

Thanks for sending credentials to the staging site. I found that first, when I deactivated all the no category plugin, the category pages did not return a 404 page. They worked correctly. I also found that if I activated just the no category plugin plus WPML plugins (and WooCommerce), I still did not see the 404 page. I then reactivated all plugins and now the site is working for both the category pages and the shop page.

So, I don't think the conflict is coming from WPML and the no-category plugin but perhaps a 3rd party plugin is interfering. You mentioned that sometimes it would work correctly. I would recommend deactivating all non-wpml plugins and leave the no category plugin and give it the same amount of time when the slugs were reverting to 404 pages, and let me know if it still happens. If it does not happen with these settings, then start to activate plugins one at a time until we find which one is conflicting.

May 3, 2018 at 3:13 am #1945935

Kim Gamez

I have narrowed it down to restrict content pro. The taxonomy and sometimes the shop page will go bad on login. So to recreate you will need to flush the permalinks and make sure that both pages are working. /shop and /es/planificacion-de-eventos/ (spanish taxonomy example). Then visit /login and login and out a couple times and it will trigger the issue.

The topic ‘[Closed] translated categories 404 or empty shop page’ is closed to new replies.