Support Forum
Support › MB Custom Post Type › Permalink issue with Custom Post TypeResolved
Hi, I'm having an issue on Metabox Custom Post Type.
When using /%postname%/ for permalink, only pages create with the Custom post type are working. Normal WordPress pages redirect to an archive page!
If I use /%post_id%/ , all is working but it show the post name, not the post id.
Debug mode do not show any error and I don't see any JS error in console.
I made this quick video to show the issue and the CPT configuration:
https://www.loom.com/share/b6a6f54771c04317b57b649f53a4ec77
Please let me know if I missed anything.
Thanks
Hi,
I do not see the issue when viewing your site, see my screen record https://share.getcloudapp.com/xQuA2qGk.
Can you please confirm it works?
Hi,
It is only working if I use the /%post_id%/ (which it is set to right now), Plain (https://site.com/?p=123), or Numeric (https://site.com/archives/123).
It is not working with any other WordPress default permalink structure. I'd like to use /%postname%/.
Hi,
I'm not able to reproduce the issue on my end. Please try to deactivate all plugins except Meta Box and MB AIO, switch to the default theme of WordPress Twenty Twenty, change the content of the .htaccess file to basic https://wordpress.org/support/article/htaccess/ then check the issue again.
Hi, The issue still persist.
Please see the video: loom.com/share/a960023c62d14db9aac82a44573e567c
Thank you
Hi,
Please share your admin site account via this contact form https://metabox.io/contact/. I will check this issue.
Hi, did you solve this problem? I have exactly the same case and before you ask for it: I do never give admin site account access to anyone. If the problem is not solved I will open an own thread, I don't want to highjack this one here.
The problem with using %post_id% is on posts (not pages or cpt). On posts the URL has a number domain.com/123 <- I would like to see the postname. But if I choose %postname% posts-URLs are fine, but then cpt-pages show "This page does not exist".
I am having the same issue, how can this be resolved please?
change premalink to plain
test
now you can change the premalink to postname
works
for every new item creation I am doing this
please fix it
I am having the same issue (and I cannot understand what the last person posted - "plain test" or "plain text"? How do I do that?).
Anyway, I tried using a custom archive slug in the "Advanced" Meta Box menu for the custom post type and it made NO difference. My custom post type is named "mjb-post" and the slug I put in is "mjb". Rather than trying to find my post under "mydomain.com/mjb/my-title", the system still wanted to list the URL to the article as "mydomain.com/mjb-post/my-title". In either case, I could never bring up the article as a published article. (I could preview it fine.) Also, if I found it by searching, a nice excerpt was listed in the search results but when I clicked the title, I was taken to the "Not Found" page. If I tried typing directly in the URL, "mydomain.com/my-title", the system redirected it to "mydomain.com/mjb-post/my-title" and again the result was the "Not Found" page.
Another bit of trivia: When I found the excerpt by searching, I could click the "Edit" link below it (logged in as administrator) and I was correctly taken to the edit page for that post. So the system understands everything about the post except the pretty URL.
I tried disabling EVERY plugin except Meta Box and Meta Box AIO. No change.
I don't know if it makes a difference, but WordPress is installed in a subdomain. I tried switching the .htaccess file for one I used originally to run WordPress out of the subfolder. No difference. The newest version has no reference to the subdomain while the old, original version did, so I'm not sure why the new one works. If I remove the .htaccess file completely, the only page URL that works is the home page, which correctly shows the excerpts but when I click on any title link, I get not only a "Not Found" error, but also that error does not display on the WordPress "Not Found" page because WordPress cannot find the "Not Found" page.
@margaretmendoclick-com you can use the option Custom rewrite slug
to rewrite the post type slug and re-save the permalink settings in Admin Dashboard > Settings > Permalinks (Post name) to flush the permalink cache.
OK I get it. The goal is to get WordPress to save the permalink structure again. I changed the permalink structure and changed it back. I may or may not have had to save a new permalink structure before saving the original again. All is well. Thanks.
This worked for me on Oxygenbuilder 🙂
The templates didn't find custom posts, so after flushing the permlinks they did!