Skip Navigation

[Resolved] Changing permalink for custom post types so they don't use post name

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

Problem:

I want the custom post types for farms and restaurants on my site to not display the post name in their permalinks, using only the post ID instead. This is because I’m building a paid member directory, and displaying the name in the URL could give away sensitive information.

Solution:

The URL structure of custom post types is managed by WordPress settings, not Toolset. To achieve ID-based URLs, go to WordPress Dashboard > Settings > Permalinks and set the structure to "Plain".
Alternatively, using a plugin like "Custom Post Type Permalinks" can help customize the permalink structure to meet your needs.

Relevant Documentation:

https://wordpress.org/plugins/custom-post-type-permalinks/

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.

This topic contains 4 replies, has 2 voices.

Last updated by Christopher Amirian 2 months, 2 weeks ago.

Assisted by: Christopher Amirian.

Author
Posts
#2741082

I would like my custom post types not to display the post name in their permalinks (post ID would be fine). This is because I'm building a paid member directory and if someone found the link to a restaurant, they could figure out which one it was based on the name in URL.

This is for farmcheflink.com and I'd like to change the URL structure of both farms and restaurants.

#2742006

Christopher Amirian
Supporter

Languages: English (English )

Hi,

The URL structure of the custom post types is determined by WordPress settings and not Toolset.

Toolset uses the native functionality of WordPress to create custom posts.

You can go to WordPress Dashboard > Settings > Permalinks and change the permalinks of your website to be ID-based.

Thanks.

#2742908
Screen Shot 2024-09-09 at 10.26.43 AM.png
Screen Shot 2024-09-09 at 10.28.27 AM.png

I tried that, but am still getting permalinks in the style of /customposttype/posttitle. You can see this in the attached screenshots. I changed the permalinks to /%post_id%/ saved twice, cleared my cache, then created a new restaurant, which got the permalink hidden link

#2743565

Christopher Amirian
Supporter

Languages: English (English )

Hi,

You need to use the PLAIN option in permalinks settings which is the first option.

That should do the trick.

if the problem persists, I'd appreciate it if you could give me the URL/User/Pass of your WordPress dashboard after you make sure that you have a backup of your website.
It is absolutely important that you give us a guarantee that you have a backup so if something happens you will have a point of restore.

Make sure you set the next reply as private.

#2744289

Christopher Amirian
Supporter

Languages: English (English )

Hi,

I will need to clarify something:

"Is there any other way to change the URL structure of Toolset custom post types"

There is no difference between a custom post type you create with Toolset or a custom post type that is created by any other plugin, such as the Products custom post type for Commerce plugin or any plugin.

Toolset uses the standard and native WordPress custom posts creation process, so finding a permalink that works in toolset custom posts is like finding a permalink structure that works everywhere else.

Hope I could convey this message correctly. So I do not have any suggestions here that is a specific one for Toolset. It is a general WordPress matter.

The plain mode is the one that I can suggest, outside of that you need to test yourself and see what works.

Thanks.

#2744533

Thanks. I found this plugin that did what I needed: https://wordpress.org/plugins/custom-post-type-permalinks/