A few lowercase words separated by dashes, describing a post and usually derived from the post title to create a user-friendly (that is readable and without confusing characters) permalink. Post slug substitutes the `%posttitle%` placeholder in a custom permalink structure. Post slug should not be ...

learn more… | top users | synonyms

1
vote
2answers
79 views

Change slug on post creation

I currently use Post name for the permalink structure. I want to add text from a field at the end of the permalink. Is there any hook for the permalink creation when a Post is published? In my case, ...
0
votes
0answers
23 views

How to add id to custom post type taxonomy term slug?

For example, if custom post type taxonomy is "cpt-category" and term is "cpt-term-11", I would like to show and link like this(*123 is term id) /cpt-category/123/ instead of ...
0
votes
0answers
27 views

URL rewrites with two post types

I have two post types: car and parts. Now I would like to be able to rewrite the url slug for parts bit differently. Right now it is like this: mydomain.com/parts/some-part-post-slug And for cars it ...
1
vote
0answers
11 views

Removed custom post type slug but not working for child pages

There are many discussions going about to handle child pages for custom post types were the custom post type slug has been removed. This results into an 404 because Wordpress can't match a valid ...
0
votes
1answer
23 views

What function removes apostrophes when making a slug?

I am trying to convert a post title to a slug. I used sanitize_title_with_dashes, thinking that's what WordPress uses. However, if my post title has an apostrophe in it, sanitize_title_with_dashes ...
0
votes
1answer
16 views

post_name is not stored until post is published… where should I store my slug until it goes live then?

important try as normal contributor user, not as admin see here I actually have it reproduced. Seems like a bug to me but whatever. I want users to choose their slug. Well, as you cannot store ...
0
votes
1answer
22 views

Hide category name using mod_rewrite

I have a website with at least 3 categories. I have set one of them as the default category. Next step was that I need to have the category slug of the default category to be hidden from the URL ...
0
votes
0answers
18 views

Two taxonomy terms with the same slug

I have 2 custom taxonomy: Phones and Tablets. I want both of them as with rewrite slug price. It is ok. But When I add the terms with the same name to them it cause an error in archive page. For ...
0
votes
3answers
33 views

Wrong slug on blog page

<?php global $post; $post_slug=$post->post_name; ?> This code is used after <head> and before <body> and is supposed to get current page's slug. It works great, however ...
0
votes
0answers
71 views

Is 'pm' used by core?

We've a private messaging system that uses the page slug pm. It lists messages. Recently, we noticed that pagination stopped working on this page. So going to page 2 gives a page not found error. ...
1
vote
1answer
40 views

How can I make sure attachment pages require a base url?

If I upload an image with the filename 8.jpg then the permalink becomes http://www.example.com/8 -- which I really don't want. How can I make attachments use their mime type as a base for the url? ...
4
votes
0answers
67 views

What is wp_insert_term “alias_of” arg for?

I currently put my hands into WP taxonomy and terms to find solutions for my project. I knew that it's not possible to have same terms slug when creating a term with wp_insert_term in one Custom ...
0
votes
0answers
41 views

WP-API custom post types request by slug

How to get post by slug in wp-api for custom types, I've been extending the api and I can fetch all posts of my custom type but I would like to get the items by slug. I see in documentation that I ...
0
votes
0answers
11 views

How can I add slug/category to portfolio permalink? [duplicate]

My portfolio URL currently looks like this: sitename.com/portfolio/ I would like to add the category slug after so it reads: sitename.com/portfolio/slug/ so that if I go to a portfolio item of a ...
1
vote
2answers
30 views

Replace taxonomy permalinks

I have this permalinks settings: /%postname%/ I have a custom taxonomy issue. I want replace all my taxonomy links (site.com/category/wordpress) to (site.com/category/wordpress/issue/any-child). ...
0
votes
0answers
10 views

Use Post's subcategory in title tag

I changed my title to: %%subcategory%% %%sep%% %%title%% But WordPress doesn't seem to recognize %%subcategory%%, in the end it simply displays - My title How should I change the title to ...
0
votes
0answers
20 views

Rewrite Rules: Post ID within Post Slug for a Custom Post Type

I've got my custom post type slug article and I need the following permalink structure: http://domain.com/article/postname-123/ The number in the end has to be the post ID. I don't want ...
2
votes
0answers
51 views

Change the author slug from nickname to ID

I've changed the default registering option by allowing people to sign up with their e-mail addresses. They also have an option to add their firstname, lastname but it's not required. // Allow email ...
1
vote
1answer
16 views

Set taxonomy slug as taxonomy title

With post types I can easily set the slug to be always identical to the post type title. add_filter( 'wp_insert_post_data', 'prefix_wp_insert_post_data' ); function prefix_wp_insert_post_data( $data ...
0
votes
0answers
25 views

Does WordPress Have Built In Filtering By URL?

About a week or two ago I was reading this article that said that WP now has built in functionality to filter what an archive page displays based on url slugs. For example, without adding any code ...
1
vote
0answers
26 views

Including taxonomy term before post type breaks top level pages

Got a website that has two top level pages called commercial and domestic, and in these pages there is other content that shares a similar format, e.g. I want case studies in both the commercial and ...
0
votes
0answers
22 views

Non unique Slugs and permalinks

I am migrating a clients site from an old code ignitor app to WordPress, with one of the biggest project briefs being "keep original data intact and make WordPress work around it" ... For almost ...
2
votes
1answer
88 views

Remove Taxonomy Slug when No Taxonomy is Assigned to Custom Post Type?

I have a custom post type called ‘sets’ and a taxonomy set up under it called ‘project’. Most of the posts under this custom post type will be assigned one project term, but not necessarily. When a ...
0
votes
3answers
69 views

How do I get slug of term by his name?

The WC_Order_Item_Meta::get_formatted() function returns terms array of the order. Each term is an array of three things: 'key' => $meta->key // attribute key 'label' => ...
0
votes
0answers
32 views

Unicode permalink slug are getting tuncated

I'm developing a website which is mainly a Bengali language based website. I'm using the post-name permalink structure. Every time a post name get longer, slug is getting truncated. Is there any way ...
0
votes
0answers
145 views

WooCommerce duplicate sub categories and product slugs

I'm building a website that allows you to hire or buy a product. I've set up the following product categories in WooCommerce: Hire Buy Is it possible to have the same sub-category slug under each ...
2
votes
2answers
139 views

How to get Plugin Slugs?

I am trying to get the 'slug' used for each plugin installed. I have not found a good solution for this. I have created this function to get all the slugs and return them in an array. I am hoping ...
0
votes
1answer
35 views

How to use a specific custom field in a custom post type as slug

I'd like use a specific custom field in a custom post type as the slug for the post. My custom post type is members and the custom field that I want to use as the slug is member_user. How can I do ...
0
votes
0answers
68 views

Removing or hiding slug/permalink from htaccess

I have this slug that i want to hide for SEO matters. My current slug is: homepage.com/company/companyname All i want is to be: homepage.com/companyname I tried lots for plugins and htaccess codes ...
0
votes
1answer
27 views

How to create a second set of tags that use the same slug or URL?

Is there a way to create a second set of tags that can use the same slug or URL? Normally, an example set of tags will look like this by default on a WordPress blog page: ■ tag1, tag2, tag3, tag4, ...
5
votes
4answers
1k views

Remove slug from custom post type post URLs

It seems that all web resources based on the subject of removing a custom post type slug ie yourdomain.com/CPT-SLUG/post-name are now very outdated solutions often referencing pre WP version 3.5 ...
0
votes
1answer
31 views

Get all terms/slugs - used, not used & in hierarchical order

I need to get all the slugs/terms - those that are used & those that are not. It's hierarchical (3-4 levels). How to get all (used & not used) terms/slugs in hierarchical order? This code ...
1
vote
1answer
34 views

CPT custom archive template does not get loaded

I have a custom content type called events that I register using the following function: add_action('init', 'events_post_init'); function events_post_init() { register_post_type( 'events', ...
1
vote
1answer
54 views

Change author base slug to user role

My goal is simple, to change authot base role to user role. For example: admin: wwww.mysite.com/admin/username editor: www.mysite.com/editor/username default looks like this to any user: ...
0
votes
0answers
91 views

Get the custom post type slug but remove the rewrite prefix?

I am trying to add a link to the parent custom post archive page in the breadcrumbs. I can get the slug using this: <?php $post_type = get_post_type(); if ( $post_type ) { $post_type_data = ...
0
votes
0answers
41 views

Custom Taxonomy Dynamic Slugs

I have two custom taxonomies named Cities and store-categories. i have following code for that register_taxonomy('cities',array('store-listings'), array( 'hierarchical' => true, 'labels' ...
0
votes
1answer
30 views

How to make a posttype show under a page hierarchy (example.com/page/posttype/entry)?

I have a page, say streets, which is a static page and has the slug example.com/streets/, and I want to have many single streets under it. Let these streets be called streetdetails, so a single street ...
0
votes
0answers
39 views

custom post type slug and redirection

I have a custom post type called portfolio (slug portfolio). In this i have entries like toys, bugs, people. So the URL will look like: mysite.com/portfolio/toys mysite.com/portfolio/bugs ...
2
votes
1answer
66 views

Creating a template using a specific slug name, for a page with a parent page

I have always preffered to create layout templates for specific pages by creating a filename the same as the slug. So for example: Page Title: Contact Us Page Slug: contact-us Filename of template ...
0
votes
2answers
217 views

If file exists with page slug name show image else nothing

I need to add a php code in a wordpress widget called PHP Code Widget which only asks for proper enclosing: All PHP code must be enclosed in the standard php opening and closing tags ( <?php and ...
0
votes
0answers
11 views

User only edit CPT with slug that matches username

I'm in a situation that necessitates I complete this project within a week. So any help or specific guidance to my question would greatly appreciated. Is it possible, without creating an incredible ...
1
vote
1answer
52 views

custom slug always ends in “-2”

I have a custom post type called task. I want the slug of each task to be an id, rather than use the entered title. I've modified the code from this SO question "How to customize this automatic slug ...
1
vote
1answer
64 views

Am I using the flush_rewrite_rules function in the right place?

Hello dears I'm writing an admin panel for my new WordPress plugin base on the WordPress Settings APIs. I am defining a field for changing custom post slug from this admin panel. After the custom ...
0
votes
1answer
61 views

WP Database generate content for post_name column

I ran a query that deleted all content in post_name (used for SEO-friendly URLs) column. UPDATE wp_posts SET post_name = '' I thought that WordPress would automatically populate new ones if I ...
0
votes
1answer
69 views

Custom Post Types and Removing Slugs - should we do it?

I've run into issues trying to remove my custom post types slugs and I've read other questions on here from people with the same problem. We don't want that slug in our URL! But the solutions to this ...
1
vote
0answers
78 views

Automatically add date to the auto generation of post slug

I need to customize the slug when you add new post and after you write title it creates automatically slug. I want to add before the auto title of the post the current date on this format d-m-y so the ...
1
vote
2answers
100 views

How to handle broken links created by permalink/slug changes?

If I create a page with the slug "exams" and then need to change the page's slug from "exams" to "tests", any other pages in WordPress that link to the original permalink now have broken links as ...
0
votes
0answers
26 views

“Project” post type to “Page”

I need the user to go to a Page when he clicks on the menu that is managed in "Projects" section (backend). Situation I have a kind of a menu managed in "Projects" section (backend), made with ...
0
votes
1answer
268 views

Get custom category image from menu

I've got myself into a little pickle, and while I'm so close, my understanding of PHP is letting me down. I want to display the image associated with each category in the menu - working from the ...
0
votes
1answer
28 views

Bulk-change Post slugs which have a suffix

I've got a bunch of slugs that look something like this: pageA-2 pageB-2 etc. Fwiw, I think I did an import, then moved those to Trash, then did another import. Because I had Pages with an ...