Skip to main content

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.

Filter by
Sorted by
Tagged with
0 votes
0 answers
17 views

Change filter id into slug

I have a link like this when filter products by taxonomy "brand" domain.com/shop/printer/?brand_id=10 I'm trying to change the link to domain.com/shop/printer/product-brand-name/ how can ...
Phuc Khung's user avatar
0 votes
2 answers
34 views

category id (term_id) in url instead of slug

For a certain Wordpress shop with woocommerce we need the url to display the category id (term_id) instead of the normal slug with the category name. So instead of www.website.com/categoryname/ it ...
Martin's user avatar
  • 1
1 vote
0 answers
32 views

How can I add codes to functions.php in WordPress to allow parentheses in slugs, similar to Wikipedia?

Since my website has a lot of pages with similar slugs, I need to add some code to the WordPress functions.php file to enable parentheses in slugs, for example: example.com/article/slug_(explanation). ...
LAUO's user avatar
  • 11
1 vote
0 answers
33 views

WordPress pagination error when using ACF CPT rewrite slug & Polylang CPT slug translation

I use WordPress with Polylang PRO and ACF PRO plugins. Using ACF PRO I've created CPT with post_type 'aktualnosc', with rewrite slug 'aktualnosci' (same slug as page name (with posts list)). I also ...
NetPax's user avatar
  • 11
0 votes
1 answer
38 views

WP appending -2 to the end of my slug

I would like to create a page on wordpress with this URL: https://my-website.org/landing-page/ However, it seems that the slug /landing-page/ has already been created in the past because it does not ...
user239943's user avatar
0 votes
0 answers
22 views

Creating Wordpress pages with post name as slug

I have an issue on a domain with a freshly installed Wordpress. I try to change my permalink structure to be Post Name so that when I create a page with the name "Test" I should be able to ...
eligolf's user avatar
  • 123
0 votes
0 answers
11 views

Changing slug when post is copied

Is there a way to rewrite the slug when copying a post in WordPress to the new title instead of having a -copy after the slug? Thank you!
Martin Hult's user avatar
0 votes
0 answers
41 views

Custom post type URl Cutomization

I am creating a custom CPT where I have customized CPT URL structure of CPT, I am using the rewrite rule for this but it is conflicting This is a Lessons CPT, and I want to remove lessons from the URL ...
Neelu Singhal's user avatar
0 votes
2 answers
73 views

Right Permalink for Custom Post Type with number slug

I am working on a little Plugin (based on a Custom Post Type called gallery) for a gallery (that reads out a large number of ftp folders). The post type does not have taxonomies but like pages just ...
inspirationally's user avatar
0 votes
2 answers
78 views

How to get a custom taxonomy slug in body classes

I've been trying without luck to get a custom taxonomy slug to appear as a class in the body tag of WordPress. Perhaps it has to do with the fact that I'm using a custom taxonomy rather than the build ...
Overspeed's user avatar
0 votes
1 answer
185 views

Custom post type slug localization

I need to have 2 languages in a website (EN and LT). I have a custom post type 'services'. I need to have the links like this: English version of the service: '/en/services/some-service' Lithuanian (...
LinasK's user avatar
  • 1
0 votes
1 answer
76 views

Show category name in category.php when posts assigned to multiple categories

I'm trying to show the category name in my category.php but it's not working when I have posts assigned to multiple categories as it chooses the first category. <h1><?php $cat = ...
user3362364's user avatar
1 vote
1 answer
85 views

Using same term for slug and category

I am having problems with a site that uses the category “vacatures” for posts. The “Vacatures” page, lists those posts. Some time ago the client has made a page called “vacatures” and replaced the old ...
andre's user avatar
  • 21
0 votes
0 answers
10 views

Article from Custom Post Types with different slugs with redirection intact

"I need the articles from my Custom Post Type 'Horóscopo' to have only the slugs of the Author and the 'Signos' Taxonomy in the link, while keeping the redirection intact."
João Pimentel's user avatar
0 votes
0 answers
110 views

Creating dynamic URLs for Product Pages

I'm working on an ecommerce website using the HivePress theme. The issue I'm facing is that I'm looking for a way for the slugs of every product/listing page to be dynamic. I have an attribute for ...
Stefan's user avatar
  • 1
0 votes
0 answers
73 views

Disable Category Link

I need some help to disable my category pages and make them not clicable. I need to disable those 2nd level slugs from going to another page.I just want them there for structure reasons, no need to ...
user22446164's user avatar
0 votes
1 answer
18 views

How to find what is causing a slug-2?

I have a page with the slug support, and after saving it, it would change the slug to be support-2. It appends a -2 at the end of the chosen slug. An overview of Posts and Pages didn't throw any ...
ecairol's user avatar
  • 113
0 votes
0 answers
57 views

How to Stop Wordpress Change Slug Automatically Same as Title When Publish?

How to Stop WordPress Change Slug Automatically Same as Title When Publish? I am optimizing my old content and editing all Old Posts, But when our writers click on publish WordPress (contributor role ...
ranbir's user avatar
  • 1
0 votes
0 answers
25 views

How to change the category and post prefix/slug to be the same in Wordpress?

Looked all over the internet to find a way to make my website work like that: Having the posts under /blog/ and the categories under /blog/ too. example.com/blog/ example.com/blog/%category% example....
Radu's user avatar
  • 1
1 vote
1 answer
25 views

What's the best way to complete links on a certain WordPress Page with everything after the slug?

I'm looking for the optimal approach to replace all links on a WordPress page with the segment that follows the page's slug. Currently, I'm encountering an issue where accessing the page with an ...
marcushorndt's user avatar
0 votes
1 answer
88 views

How to get taxonomy category in permalink for each taxonomy OR How to give a parent page to a given taxonomy?

I have two taxonomies on my site: portfolio works and blog posts. I want blog posts under /blog and I want portfolio items under /work. I have created a page for blog posts and a page for portfolio ...
JugJoe's user avatar
  • 3
0 votes
0 answers
38 views

Is there a way to enforce unique slugs across categories, tags and posts?

Digging through various sources including documentation from WordPress, my understanding is that uniqueness of slugs are limited to their respective domains. For example, you can't have duplicate ...
Motivated's user avatar
  • 215
0 votes
2 answers
28 views

Taxonomy Archive URL + Template

Working on an WP build with custom post types & taxonomies Taxonomy = Reviews Example terms = nes, snes, gamecube I've got a taxonomy archive page, taxonomy-reviews.php Going to the url /reviews/...
Jorge B's user avatar
0 votes
3 answers
2k views

Duplicate Slugs on multilingual site (with Polylang)

I have been using the "Polylang" plugin to translate my website. The original page has the URL "mysite.de/about-us". The translated page should have the URL "mysite.de/en/...
Justin's user avatar
  • 1
0 votes
1 answer
82 views

Custom Post Type slug has the same Redirection entry

So this is my case.. I have a Custom Post Type with slug /event I have this plugin installed - Redirection On the said plugin, I have a Redirection entry ^/event/(.*)/?$ which would redirect to /...
ensaymada's user avatar
0 votes
0 answers
58 views

I want to change the Post Type slug of a CPT (custom post type) to the category slug of the page

I have tried this: function change_cpt_permalink_using_category_slug( $permalink, $post ) { if ( $post->post_type === 'your_custom_post_type_name' ) { $terms = wp_get_post_terms( $post-&...
Drkay's user avatar
  • 1
0 votes
1 answer
203 views

Add post id to url instead of WordPress default -2 suffix

I have a site where Posts in a Custom Post Type will have the same title. Per default WordPress will add a number after the url to handle this but I would like instead to always include the post id ...
Peter Isaksson's user avatar
0 votes
1 answer
111 views

Create a custom plugin with dynamic child pages listing database records

I am developing a simple lean and mean custom plugin which has the purpose to list records from some database tables. Goal is to list data via url /teams/{category}/{id}. I've created a basic plugin ...
Flapoor's user avatar
1 vote
1 answer
399 views

WordPress Page Slug with URL custom template

So I want to create a custom template file for my user profile page something like this URL http://localhost/wordpress/user/username. Here you can see I have created a new page in Admin with this ...
Mittul At TechnoBrave's user avatar
0 votes
1 answer
144 views

Slug is already taken - how do I find the original item

I have a similar problem to this post: Slug Taken, Cant Find Which Page I'm needing to create a page with slug /harvest but this is apparently already taken as WP insists my slug must be /harvest-2. ...
Andrew Vincent's user avatar
0 votes
0 answers
32 views

Disable duplicate WC product category URLs

WC generates duplicate URLs when using category slugs. Example: demoshop.com/cat-1/product-a The same product can be accessed from any URL if slug "cat-1" is modified, e.g.: demoshop.com/...
Mirko's user avatar
  • 1
0 votes
1 answer
390 views

Custom slugs with dates & IDs on Custom Post Type

Trying to do something with the rewrite argument on custom post types. I'm after 2 different things here for 2 different custom post types. 1: Slugs which look like this post-name-year-month-day So ...
robwatson_dev's user avatar
3 votes
1 answer
772 views

WordPress not remembering old slugs for pages

I have several WordPress sites working under different domains, but hosted on the same server. I noticed that most of them will remember the old slug if changed. So it redirects to the new one if ...
Cain Nuke's user avatar
  • 163
2 votes
1 answer
40 views

Is it possible to use a post name in a custom post slug?

So I have custom post type called Lessons and I am using something like this for the slug register_post_type( 'Lessons', // CPT Options array( 'labels' => array( ...
Zarko Zivkovic's user avatar
0 votes
0 answers
1k views

Removing custom post type name from permalink

There are numerous threads on this, however, none of them seem to resolve the issue for me. Background I have a custom post type called "Landing pages", which has been registered like this: ...
Freddy's user avatar
  • 157
3 votes
1 answer
101 views

How to add custom prefix before category base for category page URL?

Is it possible to add a custom prefix right before the category base of the category page URL(s)? For example, in the Category Page URL: sample.com/category/top-10, category base is category, and term ...
agent abstract's user avatar
2 votes
1 answer
155 views

Pages resolve at different URLs (different capitalizations)

I've always considered these to be two different URLs: https://oursite.com/fun/ https://oursite.com/Fun/ On our site, the same page loads when entering each URL. Did something change in WordPress to ...
Drewdavid's user avatar
  • 219
0 votes
1 answer
33 views

UI does not show correct Slug after modified using save_post action

When a WP user creates a new Post the default behavior is that the Title is used as the basis for the Slug which forms a major part of the URL/Permalink. I am changing this default behavior. My code (...
donohoe's user avatar
  • 161
0 votes
3 answers
323 views

Hide custom post type slug url from search engine [closed]

I want to hide, let's say, example.com/services/washing ('Services' is the this is a custom post type) from the search engine and show a 401 error page. How do I?
Warda's user avatar
  • 105
0 votes
0 answers
81 views

How can I make "sanitize_title" affect only one taxonomy?

Is it possible to use the code: remove_filter( 'sanitize_title', 'sanitize_title_with_dashes', 10 ); Is it possible to use the code not for all entities on the site, but only for one custom taxonomy? ...
iwanesa's user avatar
0 votes
1 answer
23 views

How to create extra SUB ARCHIVE for each page?

How to add slug structure for pages like this: /page_1_name/doctors/ -> load doctors taxonomy for this page slug /page_1_name/prices/ -> load prices taxonomy for this page slug /page_2_name/...
skywind's user avatar
  • 63
0 votes
0 answers
32 views

Guest author - URL, base and custom taxonomy - working but unstable

I've had help here in the forum to create a custom guest-author taxonomy, custom guest-author url base and to redirect the main author's url (logged WP user) to the guest-author's url. It is all ...
usina's user avatar
  • 13
0 votes
0 answers
171 views

Change get_author_posts_url / Author URL via filter

I have a follow-up question to this answer here: Create guest author page via php I would like to modify the get_author_posts_url function to get a custom taxonomy guest author slug. I need this ...
usina's user avatar
  • 13
0 votes
1 answer
251 views

Ultimate get current page's slug function

Am I missing something or is there really still no built in WP function to return the current page slug on whatever page you are currently on? I understand there isn't, so I'm wondering if anyone out ...
AdamJones's user avatar
  • 328
0 votes
0 answers
105 views

Change the slug ( url ) to a sequence number starting from 0 in the custom record type?

A notionally custom post type is created - mods I want url to be of type site.com/mods/XXXX where XXXX is serial number in category (not global ID(%post_id%)) That is it starts with 0 and goes further ...
Teo Doe's user avatar
0 votes
0 answers
57 views

Different template fallback when changing permalinks

I am creating my own WP theme from scratch. Super basic stuff. But something drives me nuts. First of all, took me long time to realize that the page with all the posts is home.php. I thought it would ...
Arwin Visser's user avatar
0 votes
2 answers
665 views

how to get full category path including parent and subcategories

How do I get the full category path including the subcategories? I am using if ( is_archive() ) { $term = get_queried_object(); $page_path = $term->slug; } https://mandoemedia.com/blog/...
Steve's user avatar
  • 1,727
0 votes
1 answer
35 views

Trying to add array of paths to post permalink

Am trying to add custom path to my article posttype so my article path will be www.example/parent-post-1/parent-post-2/the-actual-post i tried to add this code /** * @param $post_link * @param $id *...
Мохамед Русланович's user avatar
1 vote
1 answer
315 views

Stripping unicode characters out of slug

I am trying to strip the following characters out of slugs: ṁ, ṭ, ḍ, ṇ, ṅ, ñ, ḷ, ṃ. I found this code here (note: I have removed public in order to get it to work) add_action('wp_insert_post_data', ...
HopefullCoder's user avatar
0 votes
1 answer
1k views

How do I add a tag slug to a category URL to filter posts?

I want to add an option to my site to filter posts by one specific tag on the category page and at the same time have a nice URL (no query strings). So something like this: https://example.com/%...
Rafaucau's user avatar
  • 173

1
2 3 4 5
16