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
1answer
530 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 ...
3
votes
2answers
649 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 ...
1
vote
2answers
434 views

generate unique slug while inserting post

How can i create unique slug while inserting a new post.. I know i can query posts and compare the records to create unique slug but I want to insert a post with unique slug at the same time. Lets ...
1
vote
3answers
577 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
889 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 ...
0
votes
0answers
10 views

WPML general prefix in permalinks [closed]

In a WordPress + WPML case, i would like to add an optional permalink prefix to affect the whole navigation: country. http://mywpsite/ (homepage - no country filter, default wpml language) ...
3
votes
1answer
3k views

Remove parent slug for child pages

I'm looking for a plugin/custom function that removes the parent slug of a child's page permalink. Something that automatically changes the permalink for child pages. Example: ...
2
votes
1answer
15 views

What user roles should have wp_unique_post_slug_is_bad_flat_slug filter applied?

I have a plugin where I need to reserve some slugs so I am using the filters wp_unique_post_slug_is_bad_flat_slug and wp_unique_post_slug_is_bad_hierarchical_slug. I apply them like this on my plugin ...
0
votes
2answers
492 views

Get plugin download URL from slug

Is there a way to take a plugin slug (e.g. 'akismet') of a plugin that is NOT currently installed and somehow retrieve the download URL of the current version (e.g. ...
0
votes
0answers
41 views

Issues with custom taxonomy

Having issue with url structure and pagination for custom post type and custom taxonomies. We have the category page of custom taxonomy working on first page but on others it gives error. Example of ...
10
votes
4answers
4k 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 ...
1
vote
0answers
51 views

Can we have same term slug in different taxonomies?

I am having problem when creating term with same slug in different taxonomies. I researched that Unique key is removed from slug in wp_terms table, so i am getting problem to figure out that why i am ...
1
vote
2answers
470 views

How to generate random numeric slugs for a custom post type?

I have this PHP code to generate a random numeric string: function generateRandomString($length = 12) { global $generatedStrings; $characters = '0123456789'; $randomString = ''; for ...
0
votes
1answer
16 views

Creating plugin for changing slug

I need help about creating plugin for rewriting slug. When you enter you post name or page name wordpress is creating slug. So I want to make some modification. I don't know how to make changes in DB ...
0
votes
0answers
28 views

Remove CPT slug in multisite installation

I would like to remove the custom post type slug from the site url. Searched hours for a solution. Didn't find a working one and can't resolve it on my own. It is a domain-based multisite ...
0
votes
0answers
11 views

How to occupy Wordpress slug [duplicate]

I'm wondering how to occupy a certain slug to prevent it from being used by my users. I want to make a custom redirect to redirect the users to my login page. So the url could be ...
0
votes
1answer
25 views

Force/Limit the post/page slug to accept only url friendly characters

Is there a way to overwrite WP slug validation function to only accept basic characters ([A-Z0-9-]) as I want to avoid the long encoded permlink. Thanks.
1
vote
1answer
508 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
1answer
23 views

How to add an attribute data-slug = “$specfic_page_slug” in WordPress menu item?

I want to add custom attribute in WordPress menu item which has specific page slug. like this - <li class="menu-item menu-item-type-post_type menu-item-object-page menu-item-101" ...
0
votes
1answer
25 views

Change user slug in Buddypress

I am creating a site with Buddypress. Everything is going good so far but default member slug for buddypress is domain.com/members/abc. I want that it as domain.com/abc like facebook and twitter. Any ...
23
votes
7answers
84k views

How to retrieve the slug of current page?

I am trying to retrieve the slug of the current wordpress page outside the loop. The title of the page returns with wp_title () but how can I get the slug? <li><a ...
4
votes
1answer
43 views

Replace Wordpress %postname% suffix with %postid%?

I run a news site and there's a Wordpress permalink issue that I have been wondering. Now, Wordpress will add an incremental numeric suffix to duplicate %postname% regardless of the directory ...
0
votes
1answer
286 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
25 views

Getting a 404 on single custom post type page when using rewrite on a custom taxonomy

I am getting a 404 on my single custom post types whilst using the 'rewrite' option in the custom taxonomy. If I take the rewrite out the single page works but the custom taxonomy archive then 404's ...
0
votes
1answer
28 views

Custom Post Type for Shortcode Use - Prevent it display as a post (with slug)

I've developed a series of plugins which can display categorised custom post types via shortcodes, along the lines of: [myshortcode myshortcodegroup="groupname"] This works just fine, however, I ...
0
votes
1answer
47 views

How to auto update post title and slug with category name when post status is updated

I need to auto update post title and slug with category name every time when post status is updated. Some function like this but with the correct code.... ...
0
votes
0answers
23 views

Custom post template for custom post type

I created a custom type post: add_action('init', 'crea_prodotti'); function crea_prodotti() { $labels = array( 'name' => __('Prodotti'), 'singular_name' ...
0
votes
2answers
66 views

Auto update post title and slug when post status is changed

I need help. Thanks in advance. I need a function that update post title and slug with some default title + current date when post status is updated from draft to published. I use this one to update ...
0
votes
1answer
27 views

Wordpress CPT slug and page slug conflicts

I have one page slug "new-site" also i have another custom post type with same slug "new-site" while i browse site http://example.com/new-site then it directally goes to archive page and show all the ...
1
vote
1answer
54 views

How do I get the category URL from get_the_category?

My loop below shows the latest 4 posts from the same category as the post currently being viewed. Its located within single.php. I'm trying to get the URL of that same category so I can link back to ...
0
votes
0answers
16 views

Wordpress Site Architecture Question

I have a multi site called 'quotes' the url of which looks like example.com/quotes/. I have some quotes under them like example.com/quotes/this-is-a-quote.html. I have some authors like ...
1
vote
1answer
50 views

pass user id in slug and get user information

I have user id and I am getting all information using user id on page with slug. When I pass the user id in slug then I am not getting user information on page. For example I have ...
0
votes
0answers
35 views

After I changed the slug of a custom post type, the single page returns 404

I created a custom post type using types plugin the post type has ad as slug, but now need to change it to card, and I edited the slug field in the types panel. the thing is that new urls return ...
2
votes
5answers
5k views

Add menu and submenu in admin with a URL instead of slug?

I use this function and hook: function mysite_admin_menu() { add_menu_page( 'Categories', 'Catégories', 'administrator', 'categories', 'a_function' ); add_submenu_page( 'categories', 'Manage', ...
3
votes
1answer
1k views

Slugs as breadcrumbs for Pages

I´m trying to create a function that creates a breadcrumb trail of Page slugs outside of The Loop. These breadcrumbs show the path from the homepage to the current (sub)page. For example, on the ...
1
vote
1answer
67 views

How to generate slugs?

I have the following situation. I accidentally updated post_name column in wp_posts tables for all rows. Now I need to update those back somehow. I have researched that WP uses this function to ...
1
vote
1answer
60 views

How to make draft posts or posts in review accessible via full url / slug?

I am running a website with WordPress 4.2 and have changed the way draft posts or posts in review status are displayed to non logged in users (these posts are, too, visible to anyone who visits the ...
0
votes
1answer
195 views

Woocommerce get the Archive/Category slug of the current category page

I want to get the slug of the current archive page. I have a slider where I want to echo the products that are in this category. After hours this is all I have and it doesn't work... <?php if ( ...
0
votes
0answers
33 views

Can I override the permalink/slug on creation

I have a plugin that imports data from an external API, creates a 'Product' Custom Post type ( or updates an existing one ) and then adds all the meta data. Every time we update the product from the ...
4
votes
4answers
6k views

Force post slug to be auto generated from title on save

I'm running a property site where many properties are sold in apartment blocks. Because of this what the content editors do is create a post/property with all the details and then use a duplicate ...
6
votes
1answer
132 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 ...
1
vote
0answers
29 views

Editors change a permalink on an unpublished post, but only admins change a permalink on a post that has ever been published?

Is it possible to have the Editors to change a permalink on an unpublished post, but only admins change a permalink on a post that has ever been published? I can hide the button for non admin but I ...
0
votes
1answer
25 views

How to create URL for Pages/Posts

I am not able to create a URL in WordPress like: www.example.com/lp/time-cost/free-trial When I add this URL, it's automatically changes to: wwww.example.com/lptime-costfree-trial Why are the ...
2
votes
2answers
241 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, ...
2
votes
2answers
290 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 ...
5
votes
3answers
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
0answers
41 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
179 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
217 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
30 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 ...