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

0
votes
0answers
17 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
1answer
141 views

403 forbidden on one page only

I can't access http://www.mysite.com.hr/biljke/ The only error i get is Forbidden You don't have permission to access /biljke/ on this server. This is regular hierarchical category for post. I ...
3
votes
2answers
194 views

Reslug a Custom Post Type

I built a plugin for wordpress with custom post types and somewhere along the line I realized that I had to rebuild the way slugs are generated. Originally, I had the cpt making default slugs like ...
0
votes
0answers
26 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
10 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
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 ...
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
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 ...
1
vote
1answer
3k views

disable permalink on custom post type

I have created a custom post type, but I do not want it to have a permalink. By default, after entering post title, it creates a perma link. I do not them to be generated. From my reading, it is said ...
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 ...
1
vote
1answer
478 views

wp_insert_post - How do I prevent incremental numbers on child pages?

I'm using wp_insert_post to dynamically generate child pages for a given page using a predefined array of values. The goal is to give each child page the same slug. For example, clicking "Generate ...
0
votes
2answers
520 views

Get ID of child from child slug, while knowing parent ID

I have a hierarchy that I need to get data from. It's the child (by slug name) that I need to get while already having knowledge of the parents. Highest Known Parent Page (slug : 'parent') |_ Child 1 ...
0
votes
2answers
708 views

Later change of taxonomy slug base not changing permalink

When defining a taxonomy I successfully set the slug base for it as well, all via functions.php. However, any change on the slug’s base (via editing functions.php again) is being recognised, i.e. it ...
3
votes
2answers
603 views

How to change ?lang=cn into /cn/

I'm trying to add languages to my wordpress driven website and i installed xili-languages plugin. Unfortunately it uses lang param to differentiate between languages and i rather have seen something ...
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 ...
4
votes
2answers
335 views

Combining Multiple Taxonomies in one URL

I'm creating a complex site with a product catalog with two custom taxonomies. They are Brands and Types. Brands - Canon - Toshiba - HP Types - Printers - Scanners - Multifunction I need a page ...
0
votes
1answer
487 views

Change custom post type slug from plugin options

I'd like to give users the option to change a custom post type slug in my plugin. Using this answer, I'm able to hardcode it into a function: Redeclare/Change Slug of a Plugin's Custom Post Type ...
1
vote
1answer
35 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? ...
-1
votes
1answer
634 views

How to get category slug link? ( include parent categories)

for example, if main category slug is cars; sub-category slug is: Ford; how to get the permalink of Ford, including its parent categories' slug? ( get_category_link() returns mysite.com/?cat=19 type ...
0
votes
0answers
16 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
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. ...
4
votes
0answers
64 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 ...
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
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 ...
2
votes
0answers
50 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 ...
5
votes
2answers
9k views

Wordpress slug issue with non-latin characters

I'm using permalinks in WP as: domain.com/category/post_name The issue is that post names have non-latin characters such as chinese, hebrew, and arabic. So it encodes them to something like: ...
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
17 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
1answer
86 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 ...
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 ...
5
votes
4answers
4k views

How to check if a slug exists?

I have a arbitrary string and want to check if a post with that slug string exists in the site. I tried to find a way to list all slugs, but can't find such a thing. Thanks
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
24 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 ...
0
votes
2answers
213 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
3answers
66 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' => ...
1
vote
1answer
50 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 ...
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
139 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 ...
0
votes
1answer
126 views

Why does post-slug not get saved for drafts?

I am trying to get the value of the 'new-post-slug' (the bit that you can edit to customize your slug for a post, but bizarrely doesn't have a 'name' attribute as you'd expect a form field to have ... ...
6
votes
4answers
23k views

Get page content using slug

I'm trying to get page content when I only know the slug string. Is there a function for this, or an easy way to do this or is this a case of doing it via SQL? Thanks very much
0
votes
4answers
4k views

Using same slug name for a page and category

I know it isn't good practice but I'm considering using same name slugs for some pages and categories on a site that I'm working on. It's a small site and it doesn't seem to affect anything in ...
2
votes
1answer
130 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 ...
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
0answers
65 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
23 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
2answers
3k views

How can I find plugins' slug?

I'm wondering how can I find plugins' slug (slug = internal name used by WordPress to do plugin updates and to determine which plugins are currently active)? It is usually plugin's folder name but if ...
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 ...