I have exported a CPT "Verhalen" from an existing site and imported into a new site. The import went well. After that I imported the actual posts via the WP Importer feature. The also went well. However, every Post results in a 404.
You can check it out here hidden link
Yes, I can edit the imported posts in the back end.
I have added a new test post, I can view the Preview, but the published version is the same 404 issue.
I have already re-saved my permalinks, did not help.
I found a (the?) solution. I have disabled Hierarchical for the CPT on the new site (even though it was enabled on the original site). Now the post is shown. How is it possible that the same settings don't work on both sites? What is so different about Hierarchical that it can break this?
Thank you for sharing this update. It is strange that it is affected by the 'Hierarchical' option.
Are the 'Permalink' settings the same on both websites? Can you please share the temporary admin login details, of the website where the issue is reproducible?
Note: Your next reply will be private and making a complete backup copy is recommended before sharing the access details.
While I can see the issue on your website, I couldn't reproduce this on a clean test website. This suggests that something specific to this website is involved.
Is the other website also hosted on the same 'Cloudways' server? And do I have your permission to download a clone/snapshot of the website, to test this on a different server?
Hi, sorry for the delay in response.
Live and staging sites are both at Cloudways, but at different servers.
It's ok to download a copy of the website.
Thank you for waiting as I worked on your website's clone.
During troubleshooting, I noticed that the option 'query_var' was also unchecked for the post type 'Verhalen'. This is what was causing it to not work when the 'hierarchical' option was enabled.
You can check the option 'query_var' on the live website too and it should be fixed.
I am not following, on the live site Hierarchical is checked and query_var is unchecked and the Posts show up fine, so "You can check the option 'query_var' on the live website too and it should be fixed." is confusing as the live site is just fine. Even when I check both boxes on the live site, the Posts still show up.
However, on the staging with Hierarchical checked and query_var unchecked, the Posts show as 404. I have to check none or both checkboxes to make the Posts work.
I'm afraid, your observation from the live website contradicts the results from my test website (and also what we see on the staging website).
Can you please share the temporary admin login details of the live website, to see if we can narrow down the difference?
Note: Your next reply will be private and though no irreversible changes will be made to the live website, making a complete backup copy is recommended before sharing the access details.
I've checked and in the 'Verhalen' post type's settings, the 'query_var' option is indeed checked.
( screenshot: hidden link )
As it is a live website, I haven't made any changes to it for any testing. But, I'm confident that if you'll disable 'query_var' option for this post type, you'll start to see the same issue with the 'Hierarchical' option, on the live website too.