We have created a few custom post types like realisations, news,... When we add a translation to a custom post type, it's not opening, it gives a 404 error.
We have Advanced Custom fields Multilingual plugin installed and activated.
In the WPML settings I've set the custom post type on 'Translatable, only show translated items' and I've translated the slug. I've the feeling it went wrong after translating the slug.
I've checked the documentation how to translate a custom post type, although I think it's pretty straight forward.
The main language is Dutch, the translation is in French. French language is at this moment only visible for admins. Let me know if I can post a temporary admin credential here if you would like to see it.
Hello Geert,
Thanks for contacting WPML Support. Sorry for the delay in responding due to the Weekend.
I understand the issue you're having. The 404 error usually appears due to the following reasons:
- Corrupted permalink structure
- Page/post is saved in draft
- The same slug is used more than once in one language.
As the first steps of solving such issues, would you please do the following steps and check if that helps?
- Please check and ensure that the slug you've used for the CPT has not been used for any other post/page in the same language. As WordPress doesn't support identical slugs, it is required to use a unique slug for each post, page, and post types.
- Please go to "Settings > Permalinks" from your WordPress Dashboard
- Resave the structure without making any changes
- Now, go to the Custom Post Type and switch to the secondary language[Using the language switcher on topbar of Admin]
- Locate the posts that show a 404 error and click on "Quick edit".
- Make sure that the 'Status' is set to 'Published'
- Clear the caches from the site.
Please let me know if the steps help in solving the issue. If you require further assistance, don't hesitate to get in touch. I'm here to help.
Since the 404 error is happening after translating the slug, you can take a look at the link below to understand what can cause 404 error after translating the slug.
If you're having the issue after ensuring that the post type slug is configured properly, a closer inspection will be required to understand the root cause of the issue.
I would like to request temporary access (wp-admin and FTP) to your site to take a better look at the issue. It would be better to have a testing site where the issue is replicated.
You will find the needed fields below the comment area when you log in to leave your next reply. The information you will enter is private which means only you and I can see and have access to it.
Maybe I'll need to replicate your site locally. For this, I’ll need to temporarily install a plugin called “Duplicator” or "All in One WP Migration" on your site. This will allow me to create a copy of your site and your content. Once the problem is resolved I will delete the local site. Let me know if this is ok with you.
IMPORTANT
-Please backup site files and database before providing us access.
-If you do not see the wp-admin/FTP fields this means your post & website login details will be made PUBLIC. DO NOT post your website details unless you see the required wp-admin/FTP fields. If you do not, please ask me to enable the private box. The private box looks like this: hidden link
Looking forward to your response.
Best Regards,
Prosenjit
The topic ‘[Closed] 404 error when opening translated custom post type’ is closed to new replies.