Questions tagged [slug]

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

211 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
1
vote
0answers
255 views

How to change the Author Slug from Username to Nickname and deal with Special Characters

I need to change the author slug from username to nickname: This is what is set by default: http://domain.tld/author/(username) This is what I need: http://domain.tld/author/(nickname)-(author-ID) ...
1
vote
0answers
162 views

Pre-populate Slug / Permalink with URL

I would like to not only pre-populate the title, tags, and categories, but would also like to pre-populate the slug / permalink as well. Can I do this and if so how? Here's my functions.php code: ...
1
vote
0answers
2k views

how do i add posts-page slug before posts slug in permalinks

I have a posts page and the page slug is /blog my current permalink structure is /%postname%/ when i click on a blog post. say for example the posts slug is adrenaline-rush the url is www.siteurl/...
1
vote
1answer
121 views

Can slugs from posts and custom post types conflict?

I have a system built on WordPress where we're using several custom post types, and I'm seeing some weird behaviour. For instance, I have a CPT called "Flyers", and I also have a CPT called "...
1
vote
0answers
984 views

Custom Post Type - Duplicate Page Slugs

I have 2 custom post type registered in my functions file, sectors and projects. There are pages with the same name and hence URL in both post type. My problem is that WordPress wont allow the same ...
1
vote
2answers
117 views

Create a page that's to not be indexed or accessible via slug

I'm in the process of creating rather complex sites with Wordpress. I'll have a page template that collects data from other pages and shows them on one page. These pages are not used anywhere else ...
1
vote
0answers
127 views

Slugs Disappeared Leaving 404s - Quick way to repopulate?

I've got roughly 3000 pages in WordPress w/ permalinks on. I recently cleaned up the database which appears to have deleted a fair amount of slugs for many of the pages. Obviously, with no slug, ...
1
vote
0answers
175 views

Problem in disabling canonical 301 redirect

I need to disable canonical redirection of category slug. My url structure for a category page looks like www.sitename.com/categorybase/categoryslug/subcategory/ Now when i change the ...
1
vote
1answer
911 views

Get posts from specific taxonomy term

I have nhl news website and I have taxonomy for each season (ex 2014-15) Taxonomy in functions: function wptp_register_taxonomy() { register_taxonomy( 'season', 'post', array( ...
0
votes
0answers
12 views

Rewrite rule not working, but only when parameter is text

I have a simple rewrite rule that changes something like /locations/?slug=times-square to /locations/times-square/. The same "location" can be retrieved by ID, so the following URL's all work and ...
0
votes
0answers
22 views

WP Slug Customization gives Error 404 / Not found (PODs Custom Post Types)

I am using PODs custom post type and I have created bi-relatation between two post types. My idea is to get a custom slug when there is a relation between two custom post types like: /custom-post-...
0
votes
0answers
27 views

How do I use the same Tag slug for different Tags?

I want to use the same Tag slug for different Tags. My URL structure will be unique basing on the category, but post_name and post_tag may happen to be duplicate in some cases. I need this for good ...
0
votes
0answers
25 views

How to use current post ID in pods single value widget?

How can I get the current post slug (or ID) to view a simple pods field in a widget? I really can't find a way to do it. In the single field pods widget there are 4 fields: Title (I can leave it ...
0
votes
1answer
49 views

Remove custom taxonamy slug with pagination

I have added the custom taxonamy for my faq site. I want to remove the default custom taxonamy showing in url for archive page. I have tried some codes, but it's break my pagination. function ...
0
votes
1answer
43 views

How can I write slugs / permalinks as: custom post type -> custom taxonomy and custom post type -> custom taxonomy (one CPT and many taxo)?

This is my first post, so maybe I'll miss some informations, sorry :bowing. I have almost the same issue as Paul T did (Permalinks: custom post type -> custom taxonomy -> post), namely : I ...
0
votes
0answers
12 views

How can I use same post slug while posts are in different categories?

Example1: www.site.site/category1/abcd-slug/ Example2: www.site.site/category2/abcd-slug/ Wordpress auto adds same number end of the slug of example2. www.site.site/category1/abcd-slug-2/ But I need ...
0
votes
0answers
19 views

wp_nav_menu slug in before item

how i can place menu item slug on before items like this: wp_nav_menu(array( "theme_location" => "mymenu", "menu_class" => "mymenu", "before_item" => "<span>$item->...
0
votes
0answers
15 views

permalinks / slugs

This is the first site I have had a problem with the page name not showing up in the domain page name. Like https://imaginedesigns.ca/?page_id=11 is the permalink that shows but my slug shows 'about' ...
0
votes
0answers
17 views

Use taxonomy term in custom post url, not the taxonomy slug

I want to use the taxonomy term in my custom post url, but not the taxonomy slug and can't figure it out. Here's what I have so far. I have a custom post type articles and a custom taxonomy sections. ...
0
votes
0answers
58 views

Proper way to dynamically load content based on url slug Wordpress

I am trying to set up a page template that can dynamically load content to the page based on the url slug. For example: https://example.com/cities/indianapolis/ loads data specific to Indianapolis and ...
0
votes
1answer
33 views

How to ignore GET parameter that’s the same as a CPT slug?

I have a custom post type called newsletter. At the same time, an implemented analytics tool (not related to my CPT) uses newsletter as a GET parameter to track some incoming links (and I can’t change ...
0
votes
0answers
14 views

Removed slug from custom post type URLs page template issues

I use this function Remove slug from custom post type post URLs to remove slug from custom post type URLs .. but now I have issues... page.php is not working ... so now my pages with default template ...
0
votes
0answers
73 views

Two Custom Post Types in Permalink + Duplicate Slugs Issue

I'm having some trouble with WP adding those numbers onto the end of my slugs if it thinks it's a duplicate slug. The issue, though, is that it's not actually a fully duplicate URL, since I include a ...
0
votes
0answers
52 views

Include a page's “category” in its URL

My site is for landing pages, not a blog - so it contains pages, not posts. I want URLs like this: https://www.example.com/shoes/nike-sport-super-red https://www.example.com/shoes/adidas-...
0
votes
0answers
19 views

How to quickly fix duplicated term slugs in hierarchical taxonomies?

my problem is that I've imported in wordpress some hundreds of terms of a custom taxonomy, from another system, in 5 languages. I've found out those terms have sometimes duplicated slugs, and they're ...
0
votes
0answers
24 views

Special Characters Url return to 404

I've managed to have permalinks with "@" (at sign) for my page with the help of @Andy's code on How to add dot(“.”) in post slug. But unfortunately, after creating post with @ on the url (example....
0
votes
0answers
17 views

Remove author (user) slug (permalink base) for a Multisite

I have a Multisite Wordpress installation in which I want to change the structure of user permalinks by removing the base "/user/" Current: domain.com/user/unsername I want: domain.com/username I ...
0
votes
0answers
29 views

Allow duplicate slugs for pages and posts

My use case is: I have a two pages, they each have a meta information "language". Posts and pages having same language cannot have the same slug, but with different slugs it is totally fine. Currently ...
0
votes
0answers
28 views

get_queried_object_id combined with wp_redirect gets wrong id

I have the following snippet of code that I am experimenting to restrict access to certain wordpress pages through a plugin. It works... almost. The browser is redirected to the login page, but the ...
0
votes
0answers
24 views

Important : This theme text domain does not match the theme's slug

My text domain is same as my theme name and theme folder also but still getting this error in theme checker : REQUIRED: This theme text domain does not match the theme's slug. The text domain ...
0
votes
0answers
88 views

How to allow dot(.) in slug for custom pages

For this question, I googled and found 2 results. But what I want to do is allow dots in slugs for some pages only. I found results are showing to add a function to function.php file. But it will ...
0
votes
0answers
31 views

Hide certain product categories from specific pages

I'm trying to hide certain product categories on specific product category pages on my woocommerce shop page. And I found this code to help me: add_filter( 'get_terms', 'get_subcategory_terms', 10, 3 ...
0
votes
1answer
25 views

Hide a specific category title from displaying on site

I have a website that uses the theme Bodega and uses portfolio categories. Right now I have a page like this: http://185.56.86.90/~onetoncr/manitoulifeandhome.com/property-services/. And it displays ...
0
votes
0answers
7 views

Auto Slug Generation for Custom Post type based on related post

I have created a custom post type (proof) that don't have any title. But it has a related post (another custom post type => review). Now how to generate slug for "proof" based on related "review"? ...
0
votes
0answers
17 views

Custom Post type slug

Is it possible to structure my CPT for using it in the url slug? E.g CPT: menupage CPT2: categorypage I will need something like this www.domain.com/menupage/categorypage
0
votes
1answer
183 views

{Check Theme Plugin} text domain does not match the theme's slug

I have these two issues: 1: WARNING: Your theme appears to be in the wrong directory for the theme name. The directory name must match the slug of the theme. 2: REQUIRED: The  <title> ...
0
votes
0answers
24 views

home page slug editor missing from WordPress

the website that I am working has been developed by a web designing company. i see that they disabled the home page slug editor but the rest of the pages has the edit option. Now I am trying to add a ...
0
votes
0answers
116 views

Wordpress pagination not working when page has /amp slug

<div class="pagination"> <?php global $wp_query; $big = 999999999; // need an unlikely integer echo paginate_links( array( 'base' => str_replace( $big, '%#%', esc_url( ...
0
votes
1answer
73 views

Make user’s first and last name as user slug

I allow users to sign up with their first name, last name and e-mail addresses. I want to make their first and last name as slug. For example user first name is “John” and last name is “James”. The ...
0
votes
0answers
47 views

How to create a standard WP Page that has the same url as an archive

I've tried to Google this but to no avail. I'm a newbie at programming but I can say I'm adept at configuring WP - pretty please, please bear with me. :) I have a CUSTOM_TAXONOMY that when viewed, ...
0
votes
0answers
32 views

Add custom taxonomy slug to URL of Custom Post Type

I have a Custom Post Type named "blog", and a Custom Taxonomy named "area" (both setup using the CPT UI plugin). I have also used below code to add the taxonomy slug in the url, so that standard WP ...
0
votes
1answer
40 views

Custom Post Type not using correct page template

I've been having trouble lately in trying to figure out why this custom post type is not using the correct template file. The custom post type is called 'job' and it has a rewrite on it for the slug ...
0
votes
1answer
451 views

Using the slug of a custom post category as prefix for the underlying custom post slugs

I'm currently using the Avada Theme that is making use of custom post types being Portfolio Categories & Portfolio Items (which are part of one or more categories). The theme is offering the ...
0
votes
1answer
61 views

How to enqueue a script on a specific URL that contains multiple parts

I've tried using is_page() to pass the URL to but the page I am trying to enqueue my script on is "races/community/add" and isn't a single slug like "about-us". Is it possible to do this with is_page()...
0
votes
0answers
29 views

Wordpress doesn't respect Page slug in custom post type url pagination. Keeps getting removed

I have a custom post type, Company, with respective company child pages. Whenever I attempt to go to a page url eg. http://example.com/company/example_company/page/2, the /page/2/ gets striped from ...
0
votes
0answers
69 views

underscore not allowed in role slug?

I created a role, 'CFI_G' in a plugin activator: if(!role_exists('cfi_g')){ add_role('cfi_g' , 'CFI-G', array('edit_gc_instruction')); } else { (note the underscore in the slug) It appeared to ...
0
votes
1answer
302 views

WooCommerce product id as permalink

Currently, the WooCommerce product permalinks is '/product/shoes-3' , '/product/cup-12' etc. How to change product permalinks to only be like /p/product_ID , for example '/p/1122' without using any ...
0
votes
1answer
33 views

List posts with slug title

The code is for single-product.php. I can list all products on page but I want to list all posts with slug titles. <?php $args= array( 'post_type' => 'products', 'order_by' ...
0
votes
1answer
46 views

I want to change the slugs of my terms dynamically

I'm looking to change my slugs dynamically so that they are displayed with the names of my terms, for that I created an option in the administrator panel that should allow me to start the process, but ...
0
votes
1answer
48 views

Change author base and slug in author link

Hello im trying to change the author link from mysite/author/username to mysite/companies/dataFromUserMetabox i tried the approach from this answer chage author url its working the url changed but ...