Custom Post Type 404 Error
Support › Meta Box AIO › Custom Post Type 404 Error
- This topic has 12 replies, 5 voices, and was last updated 2 years, 4 months ago by
[email protected].
-
AuthorPosts
-
July 29, 2021 at 2:44 AM #29751
[email protected]
ParticipantReally wierd thing just now.
I setup two custom post types using all the same parameters. "Reviews" and "States".
Both worked fine, and displayed the content fine on all pages.
I was trying to add a featured image to one of the "state" pages, and all of a sudden all state pages are now 404. "Review" pages are still fine. I've compared all settings on both, identical - as is all structure and it's the exact same type of content.
https://staging-bettingusa.kinsta.cloud/states/al/ = 404
https://staging-bettingusa.kinsta.cloud/reviews/betmgm/ = just fine.How do I troubleshoot this? I've reset permalinks several times.
July 29, 2021 at 3:33 PM #29756Long Nguyen
ModeratorHi,
If this is the link of a single state https://staging-bettingusa.kinsta.cloud/states/al/
then this link should be the archive state page https://staging-bettingusa.kinsta.cloud/states/But it links to a single page. So I think there is a page that has the same slug as the archive page. Or you've changed the permalink of the
state
post type.Please re-check both cases and let me know how it goes.
July 29, 2021 at 9:40 PM #29762[email protected]
ParticipantI have archives disabled, it worked fine - until it didn't. I don't know how to trouble shoot this, but it's not that. Plus both cases are setup the exact same way, one works and the other throws 50 404.s
July 29, 2021 at 10:27 PM #29764[email protected]
ParticipantWould greatly appreciate an extra level of support on this - It's my first time creating a custom post and I'm anxious to get back to work - this stopped me in my tracks yesterday and I'm waiting for some clarity, thanks!
July 30, 2021 at 9:11 AM #29772Long Nguyen
ModeratorHi,
Please try to change the slug
states
of this page https://staging-bettingusa.kinsta.cloud/states/ to another slug name such asstates-page
then re-save the permalink.If it still does not work, please share your site info via this contact form. I will help you to check it.
July 30, 2021 at 8:33 PM #29795[email protected]
ParticipantWhich contact form? I can't publicly post my login details obviously.
I don't understand why changing that one slug would fix this - when the other (working) CPT has the exact same setup.
Reviews and a slug of /reviews/ with sub pages of /reviews/example/
Just like slug of /states/ and sub pages of /states/example/ but one works and the other doesn't.
Can't spend a week on this so please provide some helpful support - even if I change the slug as you requested, let's say it fixes it - I still need that page to have that slug, so let's actually help here instead of providing half way answers once a day please.
July 30, 2021 at 9:12 PM #29799Long Nguyen
ModeratorHi,
It's not the problem of the plugin itself, just a conflict slug of WordPress when a CPT and page have the same slug. Then WordPress will load the page with high priority and there is no child page with this URL
/states/abcd
So you need to change the page slug or change the CPT slug to avoid this conflict.
July 30, 2021 at 9:40 PM #29800[email protected]
ParticipantYou keep ignoring the fact that the other CPT is the exact same scenario and isn't broken! I need a higher level of support please, I'm getting very frustrated with your replies.
July 30, 2021 at 9:43 PM #29802[email protected]
ParticipantYou are giving AWFUL support here. Not helpful at all, incomplete instructions - and completely ignoring one scenario working and the other not. You are wasting both of our time for 3 days now giving horrible answers.
If one CPT works just fine with this setup, and the other DID WORK FINE until SOMETHING CHANGED, clearly something else is going on - but you keep rushing through the support replies and not helping at all, forcing us to keep going in circles about this.
Please escalate to a support person who is actually willing to look at my issue and let's not go another day/s to figure it out please.
July 30, 2021 at 10:17 PM #29805Anh Tran
KeymasterHi Mike,
Sorry for the experience.
What Long was trying to tell you is that: there's a single page with the slug
stages
(https://staging-bettingusa.kinsta.cloud/states/), which might break how WordPress creates the permalink structure for single state page. I guess you don't have a single page with the slugreviews
, do you? That's the difference between them.By the way, I see you setup a
reviews
page like this (https://staging-bettingusa.kinsta.cloud/reviews/reviews/), can you share how did you set it up? It's not a single page, which explains why it works for reviews, but not states.July 30, 2021 at 10:23 PM #29806[email protected]
ParticipantI just don't know how to explain myself further - the /states/ and /reviews/ pages are both the exact same setup. Parent page with sub pages.
The parent pages of /states/ and /reviews/ and all 127 sub pages associated with them (/states/florida/ and /reviews/betmgm/) are all the exact same setup. Page and sub page.
As mentioned, I created a CPT for each, disabled archives, and all worked fine - while working on a page, suddenly all the /states/ sub page CPT's went to 404, while reviews sub page CPT's continue to work just fine.
We are still running in circles here but I am grateful to have some eyeballs helping.
July 28, 2022 at 11:37 PM #37260brandonjp
ParticipantI have this same exact same issue VERY often... even when there is no static page with the same slug. I don't understand what causes it, but here's how I usually fix it...
- change the slug of the CPT to something random/unique
- go to:
/wp-admin/options-permalink.php
& change the permalink structure - go back to your CPT and change the slug back to what you want
- go back to:
/wp-admin/options-permalink.php
& change the permalink structure to what you want
Usually that fixes it for me.
November 22, 2022 at 11:47 PM #39277[email protected]
Participantsaving the permalink structure in wp fixed that for me.
-
AuthorPosts
- You must be logged in to reply to this topic.