Sauter la navigation

[Résolu] CPT Slug

This support ticket is created Il y a 5 mois et 3 semaines. 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 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Sao_Paulo (GMT-03:00)

Ce sujet contient 1 réponse, a 1 voix.

Dernière mise à jour par Mateus Getulio Il y a 5 mois et 3 semaines.

Assisté par: Mateus Getulio.

Auteur
Publications
#2789103

I'm thinking of creating a CPT but I want the slug to be the same as my PermaLink, ie post only.
However, Toolset insists on putting the CPT slug in the UR, ie lien caché

Is there anyway I can change this so it only shows the postname? ie lien caché

#2789142

Mateus Getulio
Supporter

Les langues: Anglais (English )

Fuseau horaire: America/Sao_Paulo (GMT-03:00)

Hello Jill,

Thank you for reaching out to Toolset support!

Unfortunately, there is no native way in Toolset to remove the CPT slug from permalinks entirely. This behavior is tied to how WordPress handles URL structures. The standard WordPress URL structure requires a directory slug (like "CPT") for rewrite rules to work as expected. Removing the slug entirely can cause conflicts with other URL types (e.g., pages, archives) and may require complex custom rewrite rules.

If you'd like to explore this further, here are two resources that explain how you might achieve this with custom code:

lien caché
https://wordpress.stackexchange.com/questions/203951/remove-slug-from-custom-post-type-post-urls/204210#204210

Disclaimer: Please note that implementing such changes is not recommended due to potential conflicts with WordPress rewrite rules. Additionally, custom code modifications are beyond the scope of Toolset support. If you choose to proceed, we recommend testing thoroughly to ensure your site continues to function as expected.

If this becomes a challenge or a blocker, you might consider reaching out to a developer for assistance. You can connect with professional developers familiar with Toolset through our Contractors portal: https://toolset.com/contractors/

I hope this clarifies things for you. Let us know if you have further questions!

Best regards,
Mateus