Dear CPT Permalinks support team,
How can I remove the permalink structure altogether for a CPT and have each post be directly following the root?
So for example, I have a CPT called ‘Catalog’, which features film titles – of which the url becomes domain.com/catalog/film-title. How can I make all the posts automatically be listed without the catalog archive slug, so directly as domain.com/film-title? It’s important for this specific CPT as it’s they are the companies main products.
The ACF support team referred me to this plugin. Thank you so much for your help and your work in creating this plugin.
Warm wishes,
Twan
Hello, I am setting up the permalink structure for my travel website and I currently have this:
As you can see this leads to a 404 error because my post has 2 assigned categories
But if you remove the second one and leave the link like this:
https://thenomade.com/guides/mexico/where-to-eat-and-beach-in-playa-del-carmen-guide/
It works.
Also when I look at the custom post permalink it shows correctly in the wordpress admin
Any idea why when the second category is added the page gives a 404 error?
]]>Hello friend, with your plugin activated, I cannot change the default permalink of a WooCommerce product page, the page only works if I leave it on the default option and it gives 404 if I change permalink to another option as store base for example. Can we fix this?
]]>I have created a Taxonomy that is attached to a CPT.
Its called property-type
The term is called city and Residential parent is city.
I Am trying to remove property-type from the url.
]]>Hello, I am using jetengine and creating a custom post type, permalink inherits the “title” field. Is it possible to change the default permalink for the CPT with this plugin? Ideally randomize it with numbers?
Thanks
]]>Hello. I’m trying to set customize permalink for a custom post type but when I save, after the page reload, the options are not saved. The page returns /%postname%
]]>hi there, your plugin has work beautifully for me for a very long time, until recently.
Im not able to change the structure at all, when i try and then save it just reverts back to the original structure that is broken
/%postname% <– NO
/%postname%/ <– YES
i cannot change it or add the “/” on the end.
this issue has started on a number of my websites, new ones
help? please?
]]>Hello!
I’ve utilized the Woocommerce Product Vendors addon to create a multivendor site. I’ve successfully renamed everything on the front and backend of the site from “Vendor” to “Seller.
Except for all the permalinks!
I see that your plugin is more geared towards posts, but I’m still curious if your plugin can help me achieve this change?
Thanks for taking the time!
Jon
]]>I have created a Custom Post Type with Archive using Metabox.
I also created a Custom Taxonomy.
With Bricks I created an Archive template for this Custom Post Type.
Using Custom Post Type Permalink, I customized the URL for the Custom Post Type. It now looks like this:
example.com/custom-post-type/custom-taxonomy/post-name/.
Up to here everything works without any problems.
However, when I translate my site with Polylang, it no longer works.
example.com/en/custom-post-type/custom-taxonomy/post-name/ is not found.
Is there any way to fix this problem?
Hello, i am a french beginner developer in WordPress and i am doing a site for an artist. So i created a custom post type “portfolio” like this :
register_post_type('portfolio', [
'labels' => [
'name' => 'Portfolio',
'show_ui' => true,
'singular_name' => 'Portfolio Item',
],
'public' => true,
'has_archive' => true,
'supports' => ['title', 'thumbnail', 'editor'],
'rewrite' => ['slug' => 'portfolio'],
'menu_icon' => 'dashicons-format-gallery'
]);
}
add_action('init', 'gbl_post_types');
Then a taxonomy which allows to create categories and sub-categories to my portfolio, in fact 2 parent category and also sub-category, for example (photographie/portrait), so i created this :function create_portfolio_taxonomy() { $labels = array( 'name' => _x( 'Catégories Portfolio', 'taxonomy general name' ), 'singular_name' => _x( 'Catégorie Portfolio', 'taxonomy singular name' ), 'all_items' => ( 'Toutes les Catégories' ), 'parent_item' => ( 'Parent Catégorie Portfolio' ), 'parent_item_colon' => ( 'Parent Catégorie Portfolio:' ), 'edit_item' => ( 'Editer une Catégorie Portfolio' ), 'update_item' => ( 'Mettre à jour une Catégorie Portfolio' ), 'add_new_item' => ( 'Ajouter une Catégorie du Portfolio' ), 'new_item_name' => ( 'Nouvelle Catégorie Portfolio' ), 'menu_name' => ( 'Catégories du Portfolio' ), ); $args = array( 'hierarchical' => true, 'labels' => $labels, 'public' => true, 'show_ui' => true, 'has_archive' => true, 'show_in_rest' => true, 'show_admin_column' => true, 'query_var' => true, 'rewrite' => array( 'slug' => 'portfolio-category' ), ); register_taxonomy( 'portfolio_category', array( 'portfolio' ), $args ); } add_action( 'init', 'create_portfolio_taxonomy' );
And i display first my 2 parent categories with the “archive-portfolio.php” template then the sub-categories of a parent category with the “taxonomy-portfolio_category.php” template and the template for display one item of my portfolio is “single-portfolio.php” I would like the permalinks to be good by displaying like that : “my-site/portfolio/category/sub-category/post-title, for example : my-site/portfolio/photographie/portrait-of-woman-in-the-street.
So the problem comes from my taxonomy-portfolio_category.php code:
<div class="works-col col-xs-12 col-sm-6 col-md-6 col-lg-6 <?php foreach ($categories as $category) { echo get_sorting_class($category->name) . ' '; } ?>">
<div class="works-item scrolla-element-anim-1 scroll-animate" data-animate="active">
<?php
$parent_category = null;
$sub_category = null;
// Find the parent and sub-category terms
foreach ($categories as $category) {
if ($category->parent == 0) {
$parent_category = $category;
} else {
$sub_category = $category;
}
}
if ($parent_category) {
$parent_category_slug = sanitize_title($parent_category->slug);
} else {
$parent_category_slug = '';
}
if ($sub_category) {
$sub_category_slug = sanitize_title($sub_category->slug);
} else {
$sub_category_slug = '';
}
$portfolio_item_slug = sanitize_title(get_the_title());
// Construct the correct link based on hierarchy
$link = home_url("/portfolio/$parent_category_slug");
if (!empty($sub_category_slug)) {
$link .= "/$sub_category_slug";
}
$link .= "/$portfolio_item_slug/";
?>
<a href="<?php echo esc_url($link); ?>">
<span class="image">
<span class="img">
<img src="<?php echo esc_url($thumbnail_url); ?>" alt="<?php the_title_attribute(); ?>" />
</span>
</span>
<span class="desc">
<span class="category splitting-text-anim-4 scroll-animate" data-splitting="chars" data-animate="active">
<?php
$category_names = array();
// Sort categories by term ID to ensure consistent order
usort($categories, function ($a, $b) {
return $a->term_id - $b->term_id;
});
foreach ($categories as $category) {
$category_names[] = esc_html($category->name);
}
echo implode(' - ', $category_names);
?>
</span>
</span>
</a>
</div>
</div>
This code should construct the permalink with the parent category, sub-category, and post title but still not good, i have my-site/portfolio/photographie/photographie-beyrouth/beyrouth-1/ , that is to say /portfolio/parent-category-slug/sub-category-slug/post-title and it should be my-site/portfolio/photographie/beyrouth/beyrouth-1/ that is to say /portfolio/parent-category-slug/sub-category-slug/post-title.
After that i have installed the plugin Custom Post Type Permalinks, and configure Custom structure for ‘portfolio’: /portfolio/%portfolio_category%/%postname%/
but still not working very good.
With the Custom Post Type Permalinks plugin, the links works well, the links are /portfolio/category/sub-category/post-title but it takes me on index.php template and not on single-portfolio.php, strange…
Thank you !
]]>Somehow, your plugin causes a 404 error on three pages related to the WooCommerce plugin. When I disable Custom Post Type Permalinks, the pages are displayed again. Please help to fix it without removing plugins.
]]>One day, when I enabled debugging in WordPress, the following notis was being generated in wp-content/debug.log in large numbers every second.
I can only assume that this is a very overloaded process.
If anyone knows how to stop this, please let me know.
[22-May-2023 12:17:23 UTC] PHP Notice: Array to string conversion in /var/www/html/wp-content/plugins/custom-post-type-permalinks/CPTP/Module/Rewrite.php on line 249
[22-May-2023 12:17:23 UTC] PHP Notice: Array to string conversion in /var/www/html/wp-content/plugins/custom-post-type-permalinks/CPTP/Module/Rewrite.php on line 249
[22-May-2023 12:17:23 UTC] PHP Notice: Array to string conversion in /var/www/html/wp-content/plugins/custom-post-type-permalinks/CPTP/Module/Rewrite.php on line 249
[22-May-2023 12:17:23 UTC] PHP Notice: Array to string conversion in /var/www/html/wp-content/plugins/custom-post-type-permalinks/CPTP/Module/Rewrite.php on line 249
[22-May-2023 12:17:23 UTC] PHP Notice: Array to string conversion in /var/www/html/wp-content/plugins/custom-post-type-permalinks/CPTP/Module/Rewrite.php on line 249
[22-May-2023 12:17:23 UTC] PHP Notice: Array to string conversion in /var/www/html/wp-content/plugins/custom-post-type-permalinks/CPTP/Module/Rewrite.php on line 249
[22-May-2023 12:17:23 UTC] PHP Notice: Array to string conversion in /var/www/html/wp-content/plugins/custom-post-type-permalinks/CPTP/Module/Rewrite.php on line 249
[22-May-2023 12:17:23 UTC] PHP Notice: Array to string conversion in /var/www/html/wp-content/plugins/custom-post-type-permalinks/CPTP/Module/Rewrite.php on line 249
[22-May-2023 12:17:23 UTC] PHP Notice: Array to string conversion in /var/www/html/wp-content/plugins/custom-post-type-permalinks/CPTP/Module/Rewrite.php on line 249
[22-May-2023 12:17:23 UTC] PHP Notice: Array to string conversion in /var/www/html/wp-content/plugins/custom-post-type-permalinks/CPTP/Module/Rewrite.php on line 249
Hello, do you know if this plugin is still supported?
]]>Hi,
I want remove CPT base slug.
Example: I create “project” custom post type and it permalink is: /project/%postname% => I want remove “project” in permarlink.
Your plugin don’t have option for this. I use “Remove CPT base” plugin: https://www.ads-software.com/plugins/remove-cpt-base/. Your plugin current version don’t work with this plugin, please check.
Thanks
]]>Hello,
I am using Charitable plugin and wanted to give each campaign/participant a unique URL by using a tag.
For the 2022 edition, they would all get MM2021 in the url (from the MM2022 tag).
We are now working on the 2023 edition, but WordPress doesn’t see the uniqueness of each url. Which is possibly caused by the fact that the text in the tag doesn’t actually do anything.
For example:
https://www.mysterymountain.nl/campaigns/mm2023/pieter-krol-2/
Gives the same page as
https://www.mysterymountain.nl/campaigns/mm2021/pieter-krol-2/
or
https://www.mysterymountain.nl/campaigns/blablabla/pieter-krol-2/
and
https://www.mysterymountain.nl/campaigns/this-is-not-a-tag/pieter-krol-2/
Is this due to Charitable? Or does this plugin not add anything to the url?
]]>Translation of plugin names using LOCO is not supported. Thanking you in advance.
]]>Hi.
I need solution for changing link.
I have CPT – news.
I added rules: /%news_categories%/%postname%/
My link: localhost/news/events/test
So /custom_post_type/custom_taxonomy_category/post_name/
How can I remove news(/custom_post_type/)?
]]>I have a custom post type called ‘listing’ and a category ‘city’.
I would like the URL to read site-name/%city%-listings/%post-name%
Is this possible with this plugin?
Hi crew,
Thanks for making a great plugin. I’m using CPT UI to make custom post types and have custom template for this post type. I would like to edit the permalink but am having trouble. Is it possible for the url to be example.com/slug/%year%/%monthnum%/%day%/ ? I have not been able to get this to work. When attempting to view this permalink structure, the site 404s. The only way to get the page to load is with the %post_id% added.
Thanks,
Will
Hi guys,
I’m using this rule for a custom post type:
add_action( 'init', 'rewrite_glossary_permalinks' );
function rewrite_glossary_permalinks() {
register_post_type( 'glossary',
array(
'label' => 'Glossary',
'public' => true,
'has_archive' => false,
'show_in_menu' => 'cmtt_menu_options',
'show_in_rest' => true,
'rest_base' => 'glossary',
'rewrite' => array(
"with_front" => true,
'slug' => 'guides'
),
'cptp_permalink_structure' => '/%glossary-categories%/%postname%'
)
);
}
If I set an initial taxonomy value for the %glossary-categories% and then I change that to a new one, I will end up having 2 URLs for the same post. Both URLs are working and pointing to the same post, but I only need one to work (the latter).
Example:
https://www.websitename.com/guides/parent_category/child_1_category/postname
https://www.websitename.com/guides/parent_category/child_2_category/postname
I have updated the permalinks (cleared transients), etc. But it seems nothing has any effect on this.
Do you have any suggestions?
]]>I have a custom taxonomy that’s registered to the “post” post type. I also have the “Use custom permalink of custom taxonomy archive.” checkbox selected under Settings > Permalinks. This combination causes the following error:
Notice: Trying to access array offset on value of type bool in /wp-content/plugins/custom-post-type-permalinks/CPTP/Module/Permalink.php on line 407
If I unhook the custom taxonomy from the “post” post type, the issue goes away. If I unselect the above checkbox, the error goes away. However, I would like to use both.
]]>hi
is it possible to place the year before the CPT, like:
example.com/year/post_type_slug/
instead of
example.com/post_type_slug/date/2010/01/01
I see that this has not been updated in 7 months. Just checking to make sure this is still supported and to see if an update is coming soon? We like to check if we don’t see an update within 6 months.
Thank you!
hi, thank you for your help. I am using wck for custom post types and I implement Custom Post Type Permalinks for the url and then
and then the link works without having to show the name of the custom post type which in this case is article. but then there is a conflict with elementor when I want my link to have a /target=? added. So https://www.deracheha.org/prayer-3-upon-arising/?target=qa does not work The only way to make permalink structure work with Elementor is to use full article URL without rewrite slug applied. Elementor wrote to me that If you do not want to use the word Article in the URL. It seems that Elementor clashes with these settings
any advice would be appreciated. thanks
]]>I’ve been using this plugin for a year now, works pretty well
I’ve installed Woocommerce and tried to access the my-account pages, but unfortunately the sub pages endpoints are getting 404: my-account/orders, etc…
I’ve tried deactivating Custom Post Type Permalinks, and than all my other pages stopped working, tried purging the permalinks but still all of the regular pages are getting 404.
I’m kinda lost now,
I’ll appreciate your help dealing with this sceneario,
THanks
Hi,
I have created a custom post corporates having industries as categories. My single page URL looks like follows:
:site-url/industries/%industry-category%/single-post-slug
Using this plugin I have made the name of the category dynamic. So instead of %industry-category% the category of the post gets printed.
Now the problem is if a post does not contain any category(industry). The %industry-category% gets printed in the URL. Which looks really bad and also not good for my SEO.
In this scenario, if a category is not available %industry-category% should not get printed.
Thanks
]]>Hello
I have install your plugin and works great for me however when I publish a custom post on schedule and want to see the preview the link take mes to the preview part but game me 400 Bad Request, is there any option where I can fix this??
this is the link – https://everson.org/explore/%status_exhibitions%/faceted-wrap-by-derek-porter/?preview=true
as you can see the status_exhibitions is the custom post
if i use the same link with 25 it works well
https://everson.org/explore/%25status_exhibitions%25/faceted-wrap-by-derek-porter/?preview=true
thanks in advanced
wally
いつもこちらのプラグインを愛用させていただき、大変助かっております。
貴重なプラグインをご提供いただき本当にありがとうございます。
今日、新規のサイトを作成していて気づいたのですが、カスタム投稿タイプのページのサイドバー等に設置している、wp_get_archives()
で出力されるリストのリンクから、年別のアーカイブページに行こうとすると、404エラーになってしまうことに気づきました。
これまで正常に動作していたはずの既存サイトも、調べてみたところ、いつからか同じ現象になっていました。バージョンは最新の3.4.5です。
アーカイブページへのリンクから/date/
が抜けてしまっていることが、原因かと思うのですが、どうしても改善方法がわかりません。パーマリンク設定で、/%post_id%/
を/%postname%/
に変更すると、なぜかリンクが復活いたします。
これまで、パーマリンク設定下部のチェックは2つとも付けておらず、これが原因かとも思い試しましたが改善は見られませんでした。
WORDPRESSやphpが詳しくないので、無知ゆえの大変お恥ずかしい質問かもしれないのですが、パーマリンク設定を/%post_id%/
のまま、年別アーカイブページを正常に表示する方法があれば、教えていただけましたら幸いです。
よろしくお願いいたします。
]]>Whenever I try to save a draft or publish my custom post type, I get this very long error warning: https://imgur.com/a/qR1geJY
I am using the latest version of the plugin
]]>I currently use Custom Post Type Permalinks on my website, and it is creating an issue that randomly redirects users to internal websites, and we cannot figure out why.
For example; some people might click on our domain from a google search for the first time, and they will get redirected to a random (internal) product page instead of the homepage. I noticed the other day, when taking an order for someone; after the order was placed…instead of going to the order confirmation page…the site redirected to a random unrelated product page.
Ive heard many times, when I send someone a url to one of our products on my website thru text message, when they click on it, it will load a totally different product …and I think its related to that redirect issue.
Ive spoke to developers, and they keep pointing back to this plugin. Any guidance would be appreciated.
]]>