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.

224 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
5
votes
1answer
895 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 ...
3
votes
1answer
28 views

Prevent changing the length of post_name column on WordPress Update

We've some Arabic websites running on WordPress, and use Arabic slugs in the posts' URLs. You know that post slug is stored in the post_name column in wp_posts table, and the default length of this ...
3
votes
1answer
181 views

Plural Category Base Slug On Category Archive Page

I've got a little problem with the category base slugs. Say I have got a category called 'Resources', with the category slug set to 'resource'. So any post in the category resource will appear with ...
2
votes
3answers
91 views

How I Can Use The Get Value as A Slug

in my single.php i took a data from one $_GET[] value and i'm using this like domain.com/example-slug/?holder=value The thing i want is domain.com/example-slug/value or domain.com/example-slug/...
2
votes
0answers
212 views

Best way of removing emoji support from url / slug only

Couldn't find anything on the topic. I guess something could be done with the 'wp_unique_post_slug' filter but how would I go about just removing the emojis from the slug? I've tried all kinds of ...
2
votes
0answers
193 views

Allow UTF-8 characters in the user slug part of URL

I want to be able to specify a custom slug for an author URL that may contain UTF-8 characters. I used the plugin Edit Author Slug but it does not accept UTF8 characters like accented characters, ...
2
votes
0answers
597 views

Import Wordpress Post Slug with Forward Slash

Building a news site in Wordpress. Importing articles from old, custom-built site. I want the imported URLs to be the same, to preserve SEO equity. The URLs should look like: site.com/category/...
2
votes
0answers
48 views

Removing “category” from URLs then “add_endpoint()” won't work…

For example, the original URL would be http://localhost/category/sub_category/. What I want is http://localhost/sub_category/, furthermore, I want to add an endpoint to the URL which looks like http:/...
2
votes
0answers
2k views

Custom Post Type with two hierarchical Custom Taxonomies: strategy to generate best permalink structure

this is my situation: I have a Custom Post Type named struttura (like accommodation): function custom_post_struttura() { $labels = array( 'name' => _x( 'Strutture', '...
1
vote
0answers
22 views

Rewrite URLs - Custom Post Type - Post Slug, Taxonamy Slug

Am using a third-party plugin for listing schools. Custom Post Type = school Custom Post Taxonomy 1 = school_type (eg. values = Primary, Intermediate) Custom Post Taxonomy 2 = school_location (eg. ...
1
vote
0answers
17 views

Custom rewrite url category

I'm trying to add custom rewrite rule for my custom post type. What I want is that www.domain.com/erlebnisse show all posts (that works). Also I want that www.domain.com/erlebnisse/category shows all ...
1
vote
1answer
48 views

Preserve old website URL structure after migrating to Wordpress

Old (non-Wordpress) URL structure: "News" and "Gossip" are categories "Italy" and "Uk" are subcategories https://example.com/news/italy https://example.com/news/uk https://example.com/gossip/italy ...
1
vote
0answers
13 views

Need to return a list based on Slug

I need a search field to return only a specific slug when the user types it. Basically, I need to create pages for students and each student page will be displayed only when user types the page slug ...
1
vote
0answers
24 views

force permalink slug for page vs post_type slug parent

I have setup permalink for post_type "directory" with this slug domain.com/directory/company-name now when I try create page with domain.com/directory is detect as parent of post_type "directory" ...
1
vote
1answer
116 views

WP_Query tax query part of slug

I have problem with filtering post with tax query. I have a custom taxonomy called 'actors' and example of the slug is 'david-hasselhoff'. The problem is the post is found when I search with 'david ...
1
vote
0answers
18 views

Index page with the same id as the slug

I have wanted to ask this for a long time.. I have never worked out how to do this, is it possible? mywebsite.com/pots - This to be an index page showing posts or custom posts mywebsite....
1
vote
0answers
80 views

Is there an equivalent of the PHP function sanitize_key in Gutenberg?

In WordPress's PHP library there is a function sanitize_key used to generate database keys and HTML IDs. I'd like to generate a slug from a title that can be used as an HTML ID, from within a ...
1
vote
0answers
76 views

The default code for “posts_nav_link” on category.php isn't working

I am trying to make my own simple WP theme from scratch and I have run in to some difficulties. Maybe someone can help. I have a category named "News", whose slug is "news". The permalink structure ...
1
vote
1answer
46 views

How can I make the slug of the taxonomy also the slug of the custom post

I have a custom post type and I need to change the slug to match the category. The same as if in the permalink of the blog posts I associated the category with %category%, but in the custom post with ...
1
vote
1answer
49 views

How to edit URL Slug?

Some of my blog post slugs show abnormal characters within the edit post screen (ie. 3%e2%80%8b-%e2%80%8bperks%e2%80%8b-%e2%80%8bof%e2%80%8b-%e2%80%8bsmartphone-based%e2%80%8b-%e2%80%8belds) but shows ...
1
vote
0answers
28 views

Assign same parrent Page to pages AND custom post types

I have a page, where I list our current free job positions, let's call it Career. In it's content all custom post types of type job_position are being displayed. For some specific reasons I need to ...
1
vote
0answers
87 views

Memberpress custom fields - filtering content

I'm working with MemberPress for a subscription site. The client requires an options within every plan to give the option to filter the content within their subscription based on a checkbox within ...
1
vote
0answers
419 views

Allow duplicate slugs for custom post type with taxonomies

I have set up a custom post type (team) and a custom taxonomy (team_tax) for this post type, both with the same slug. Down to the core: register_post_type( 'team', array( 'labels' => ...
1
vote
0answers
45 views

How can I change a media attachment URL/slug, so that I can use that slug for a page?

As in the title. Yoast is now installed so that all media page URLs redirect to the image itself, but how can I change that slug for the image? It's currently using the slug I'd like to use for a ...
1
vote
1answer
263 views

Nested Custom Post Type or Custom Post Type Parents?

I'm looking to create some functionality on my custom theme I'm not sure if I need to research nested CPT or CPT with a page parent. So my site will have two pages Cars & Bikes Each car & ...
1
vote
0answers
124 views

Duplicate category slugs from pages and posts

We are working in a new website and having issues with duplicate categories slugs from "posts" and "pages". We are trying to develop the same structure of this website: https://coconuts.co. We ...
1
vote
1answer
130 views

Programmatically rewriting slug through functions.php but returns 404

I wanted to change the slug of a certain post type (in this case, article) into whatever a certain value in its custom field. I went to functions.php and put this code. function na_remove_slug( $...
1
vote
1answer
230 views

Create a custom php page and load it at a specific slug

I have this painful problem with a client. They need to load a feed from a remote endpoint into a page that fits their WordPress template design.. They also want to display the page at a particular ...
1
vote
0answers
191 views

Sort order by slug for looped child terms of custom taxonomy

I have page that displays multiple carousels that contains the posts for each child term of parent taxonomy: projects for the custom taxonomy: portfolio-categories for CPT: portfolios. When Portfolio ...
1
vote
1answer
222 views

Custom Post Type with Same Page URL

I have set up a page with the URL slug "announcements" I also have a custom post type with the rewrite set to the same name: 'rewrite' => array('slug' => 'announcements'), This all works fine....
1
vote
0answers
652 views

Include parent and child in category url

I've seen a lot of questions like this, bot none that could solve my problem. For example: How to include parent terms in hierarchical taxonomy URLs? I've created a custom category with the ...
1
vote
0answers
29 views

Add Custom Slug Tags Per Page

So I want to be able to have dynamic slugs for my Woocommerce "My Account" page, basically the current format is http://www.example.com/my-account/but I want to make the parent page the Buddypress ...
1
vote
0answers
204 views

How to show “slug” in admin column?

function my_school_taxonomy() { register_taxonomy( 'schoolcategory', 'school', array( 'label' => __( '學校分類' ), 'rewrite' =...
1
vote
0answers
449 views

get_permalink returning site home url instead of the url of slug being passed

I am fetching some testimonials data from db and based on the slugs, I am getting the links to use further. Here is my code function createPageForTestimonials($slug, $title, $content, $companyName){ ...
1
vote
0answers
44 views

wp not making CPT permalink / slugs unique

I've registered a custom post type on my site but loads of different users are able to create posts with the same slug / permalink, here is how I am registering my post type // Bucket Custom Post ...
1
vote
0answers
96 views

How to prevent a CPT's slug and page slug from conflicting with each other?

I have a custom post type made and it uses 'slug' => 'treatments’. I also have a page made in the back-end that uses /treatments/, but because I have 'has_archive' => false the page loads fine. ...
1
vote
0answers
75 views

Custom Post Slug same as Parents Category Slug

I have removed /category/ slug in my URLs with Yoast SEO and i have category with parent and child i.e: anime chuunibyou anime info in another case, i have a custom post type with slug anime (same ...
1
vote
1answer
752 views

Append date to custom post type url slug

I have a sports website that will have very similar slugs: http://example.com/match/teamA-vs-teamB Sooner than later, teams A and B will play again, and the slugs will repeat themselves: http://...
1
vote
0answers
122 views

Mod_Rewrite to show only last subcategory in URL

I have a website with a three-tier hierarchy of categories: Main category> Subcategory> Second Level Subcategory. In the URL I would like to get only the currently selected category displayed. ...
1
vote
0answers
273 views

WordPress Menu Walker: add #hashes to child page links (only)

A WordPress project consists of normal first-level pages and some pages that have children. Instead of having single child pages, there is a template for any page that has children that pulls the ...
1
vote
0answers
31 views

Multiple (two) category postings on the same page.

I want two different post categories to display on one page, different divs. I have a page called list.php which posts all the content from a category using $this->getPostListHtml() I added ...
1
vote
1answer
213 views

How to have posts have a parent in permalink like site.com/blog/postname

I have a site that I'm working on and I want to have a custom blog page. Unfortunately if I use Settings>Reading to set the blog page it clears out my custom blog page. Since I can't set the blog ...
1
vote
1answer
146 views

Permalink help with default Posts and custom Taxonomy

currently building a custom magazine site and running into some rewrite issues. I'm using the default Posts post type, and have added in a custom Taxonomy for Issues (issue_cats). Everything works ...
1
vote
0answers
726 views

Edit page slug after save, cause 404 by linked pages

I have two page bar page at url: http://www.example.com/bar/ foo page at url: http://www.example.com/foo/ bar page link to foo page in content, eg.: <a href="http://www.example.com/foo/">foo&...
1
vote
0answers
41 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 ...
1
vote
0answers
43 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 regex....
1
vote
0answers
44 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 ...
1
vote
0answers
524 views

Automatically add date to the auto generation of post slug

I need to customize the slug when you add new post and after you write title it creates automatically slug. I want to add before the auto title of the post the current date on this format d-m-y so the ...
1
vote
1answer
186 views

Visting slug for 'post' post type shows 404 not archive?

I'm trying to get the WP default post type 'post' to show under the slug of /news/. I've changed the permalink structure to /news/%postname%/ which is fine when visiting a single page, however when I ...
1
vote
0answers
1k views

Remove Custom Post Type Slug and add Custom Taxonomy to Permalink Structure?

The wordpress theme I'm using uses a custom post type called 'coupon' and a custom taxonomy called 'store'. The default permalink structure for a coupon post is site.com/coupon/CouponPost I would ...

1
2 3 4 5