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
21 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
8 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
23 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
9 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
20 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
17 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
13 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
27 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
15 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
23 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
41 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
20 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
  • 205
0 votes
0 answers
22 views

I need help with removing words or changing bulk slugs

Heres the best example. urls are in a domain.com/locations they say domain.com/locations/used-honda-cbr-goldwing-in-sarasota-fl I need them to say: domain.com/locations/used-honda-cbr-in-sarasota-fl ...
William's user avatar
0 votes
2 answers
26 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
2 answers
709 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
24 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
31 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
114 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
82 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
0 votes
1 answer
96 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
0 answers
18 views

How to change permalink structure off default posts and also CPT's posts

For example, I need "name of post type / name of post" when I am on single post page and when I am on category page it must look "name of post type / category / category name"
Vasyl Savka's user avatar
0 votes
1 answer
57 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
20 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
198 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
409 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
29 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
443 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
  • 147
3 votes
1 answer
80 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
0 votes
0 answers
45 views

How to disable page create for custom post type, but allow a page with the post types slug to be created?

I have a custom post type called integrations, which I have registered like this: register_post_type( 'Integrations', theme_build_post_args( // $slug, $singular, $plural 'integrations', '...
Freddy's user avatar
  • 147
0 votes
0 answers
23 views

Remove /Page/ from slug when we're visiting 2nd and other inner pages of the blog page

I want my site shows all WordPress pages, including archives and categories, without URL/page/ slug. Examples: www.mysite.com/page/03/ -> www.mysite.com/03/ www.mysite.com/blog/page/2/ -> www....
Jornes's user avatar
  • 743
0 votes
0 answers
92 views

Display custom data based on URL slug

I have a seemingly trivial question on how to display custom data from an (external) database based on the URL slug. I feel like there must be a plugin for this, but I can't seem to find anything. ...
Jack Jhonsen's user avatar
2 votes
1 answer
90 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
  • 189
0 votes
1 answer
26 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
  • 153
0 votes
3 answers
208 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
67 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
0 answers
20 views

Same slug for Custom Taxonomy archive and CPT archive - Rewrite rule not working

I’m using a CPT (wg_seo_chat) together with a Custom taxonomy (wg_chat_category). Additional rewrite rules are in place to inject the Taxonomy into the URL: CPT archive: domain/hilfe-chat Taxonomy ...
locke85's user avatar
0 votes
1 answer
21 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
31 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
114 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
126 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
  • 318
0 votes
0 answers
93 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
49 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
442 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,677
0 votes
1 answer
34 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
242 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
737 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
0 votes
1 answer
21 views

How to assign php file(template) to several pages with same prefix page name/slug

Can I assign WP php file (specific template) to several pages with same prefix name/slug using (if is_page(){}) ? If it's possible it could be useful. Is there a php function to do like css selector : ...
imagIne's user avatar
  • 41
0 votes
1 answer
249 views

Set term on an attachment using wp_set_object_terms and want to display the full term text but it's showing a slug instead

I have a form that visitors use to upload files and fill out information about them and a function that adds those files to the media library and set various fields (including some custom taxonomies) ...
Mike Eng's user avatar
  • 238
1 vote
1 answer
226 views

Gutenberg Editor: dynamically edit slug field based on ACF field

I'm trying to edit the slug field on the right panel of Gutenberg editor and edit its content based on a custom field. I noticed that I can access the field by using this JavaScript to interact with ...
Auraylien's user avatar
0 votes
1 answer
299 views

Gutenberg Editor: dynamicaly change slug field with an ACF field

I have a custom field with ACF named "short_title" and I want the post's slug based on this field instead of the post title field. I already wrote this code: function testSlug($post_id) { ...
Auraylien's user avatar

1
2 3 4 5
16