Skip Navigation

[Resolved] Rewrite rules not working in custom post type slug and archive

This thread is resolved. Here is a description of the problem and solution.

Problem:

I am trying to set up a new custom post type with the regular slug and archive rewrite rules. For some reason WordPress is prepending "/blog/" onto the slug even though I have chosen to rewrite.

Solution:

The client fixes this by duplicating an existing custom post type and then changing the name and slug etc.

Relevant Documentation:

This support ticket is created 4 years, 7 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 2 replies, has 2 voices.

Last updated by liatG 4 years, 7 months ago.

Assisted by: Luo Yang.

Author
Posts
#1632579
permalink settings.jpg
just a test.jpg
Blog slug in url.jpg
blog slug in knitalong post url.jpg
blog slug in archive url.jpg
rewrite settings.jpg

I am trying to set up a new custom post type with the regular slug and archive rewrite rules. For some reason WordPress is prepending "/blog/" onto the slug even though I have chosen to rewrite.

I created a test post type just to check and the problem persists. In the past when I created custom post types this error has not happened.

Custom post type: Knitalongs
Desired Archive url: hidden link
Desired post slug: hidden link

hidden link

#1632829

Hello,

I have tried the settings as the screenshots your provided above, but I don't see the same problem.

So the problem is abnormal, please check these:
1) Dashboard-> Settings-> Permalink, save and test again, this should be able to reset your website Permalink rules.

2) In case it is a compatibility problem, please deactivate all other plugins, and switch to wordpress default theme 2020, and test again

3) If the problem still persists, please provide database dump file(ZIP file) of your website, I need to test and debug it in my localhost, thanks
https://toolset.com/faq/provide-supporters-copy-site/

#1634811

Hi Luo,
Thank you so much for checking on this for me. While saving my permalink settings again didn't change anything, I was able to make it work correctly by duplicating an existing custom post type and then changing the name and slug etc. Who knows why creating a new one from scratch isn't working!
I will try your troubleshooting steps in case the workaround stops working for me. Thank you!