There doesn’t seem to be an option to completely remove the post-type-key of my custom post type from the permalink URL? Right now they’re displaying:
mydomain.com/post-type-key-here/{post-slug}
Standard wordpress pages don’t have /page/ in the URL so how can I remove the post-typ-key for my custom post type from the permalink so it looks like a page URL:
mydomain.com/{post-slug}
There are three permalink options in the settings but none of them seem to cover this. The URL structure of the site I’m rebuilding in wordpress (from an old Joomla framework) has that format so I need a solution to match this.
This is a feature of CPTs. It can be altered but it cannot be removed. Without a post type slug WP will not be able to find the post.
Looks like now it is possible with the latest ACF (v6.3).
I got the ide from stackoverflow, where @cybmeta suggested to “set the slug argument for your custom post type to ‘/’ when registering the post type”. I did the same with ACF and now it seems like it is working well.
❗ Oh well, it was too soon to celebrate. While it does work by removing the post type prefix, it also breaks all page links resulting them in 404. Unfortunately I can’t remove/edit my previous reply.
To achieve the desired permalink structure for your custom post type, you can use a plugin like “Custom Post Type Permalinks” or add custom rewrite rules in your theme’s functions.php file. These methods allow you to customize the permalink structure to remove the post-type key from the URL, making it resemble a page URL. Remember to flush your permalinks after making any changes for them to take effect.