Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
Join us in building a kind, collaborative learning community via our updated Code of Conduct.

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 ...

1
vote
2answers
57 views

Why don't WordPress post slugs allow accents?

If you create a post whose title has an accent in it and some other unicode character in it, eg à 漢語 title thing, its slug (permalink) will become a-漢語-title-thing... ie, the à was converted into a ...
1
vote
1answer
22 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( $...
0
votes
0answers
24 views

Remove base slug from custom taxonomy url

I have created a CPT and have removed its base url slug using the following code: /** * Removing Slug from CPT */ function remove_slug( $post_link, $post, $leavename ) { if ( 'cpt_slug' != $...
0
votes
1answer
24 views

Matching slug terms from one array to those in array of WP_Term objects to output term names

I'm using WordPress's get_terms to return an array of WP_Term objects containing the term_id, name, slug, etc. for the child terms of a given taxonomy. I've saved this array to $tax_terms. I have a ...
2
votes
1answer
51 views

Duplicate Category and Page URL loads Category instead of the Page

I have created a Category with the slug service, which has the permalink: https://example.com/service. and a Page with the link: https://example.com/service. In the Category service, there is a post ...
0
votes
1answer
28 views

Does WordPress automatically redirect url without parent slug?

I inherited admin duties for my organization's site. Ive noticed that if I enter a url with a child slug only (and drop the parent) it seems to redirect to the full url. Ex: www.example.com/child-...
0
votes
1answer
16 views

Change permalink incrementor into pseudo-subdirectory

how I can change permalink from www.mydomain.com/lyrics/title www.mydomain.com/lyrics/title-2 www.mydomain.com/lyrics/title-3 to www.mydomain.com/lyrics/1/title www.mydomain.com/lyrics/2/title ...
0
votes
0answers
16 views

Prevent user to publish article based on slug

I am looking for a plugin/code to fix wordpress slug issue. Current behavior is if we have an existing article ... example: /selling-a-computer/ And we create another article and give it the same ...
0
votes
1answer
30 views

How to rewrite slug of custom post type archive page

I have a CPT called "case-studies" and the slug of the archive page of this cpt is www.my-domain.com/case-studies and the slug of the ctp posts is www.my-domain.com/case-studies/case-study-name. Now, ...
1
vote
1answer
25 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 ...
0
votes
1answer
75 views

Remove /product/ from url. I want only category name then product name

I have a site https://abc/product/accessories/beanie/ But I want this https://abc/accessories/beanie/ Mainly I have to remove /product/ (/shop/) from url. Using this I got right permalink but ...
0
votes
1answer
35 views

How to change a Wordpress term's slug before saving

We are using WP All Import to import product data from a CSV into WooCommerce. Everything works fine (great plugin!) but we have one problem: Two of our product attributes contain disallowed symbols: ...
0
votes
0answers
17 views

How to have theme auto add Slug to custom post type?

I AM A NEWBIE SO BARE WITH ME I have a wordpress movie them which i did some custom edits to and its working fine. But i am trying to automatically add slug (seasons & episode slug) to a custom ...
1
vote
0answers
36 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
35 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....
3
votes
2answers
100 views

Exclude specific slug in 'get_terms'

I have a custom taxonomy "role" for my custom post type "People". When listing the roles, is there a way to exclude roles based on slug and not ID via get_terms function? I ask because I'm running ...
0
votes
1answer
38 views

Delete Redirect Slug For Specific Post

I have a couple of posts that are getting hammered by bots so I want to change the permalink slugs. However, when I do so WP redirects from the old to the new slug. I want the old slug to give a 404. ...
1
vote
0answers
38 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 ...
0
votes
0answers
17 views

Use default permalink for custom post (and no slug) [duplicate]

I'v created a custom post type with this code : register_post_type('Villes', array( 'labels' => array( 'name' => __('Villes'), 'singular_name' => __('...
1
vote
1answer
15 views

Stop / prevent WordPress from updating permalinks of custom post type

I have a WordPress installation with a custom post type with a whole bunch of posts. These posts all have a unique permalink which is being generated by FileMaker and synced with WordPress. This ...
0
votes
0answers
19 views

Wordpress adding -2 to the slug of every new post

This is a weird one. I get that WordPress adds -2 to duplicate posts even if that post isn't in the trash and is stuck in the database. But, I am getting an error where every new post I create, if I ...
0
votes
0answers
15 views

How to make WordPress create a query based on a slug?

How to make WordPress create a query based on a slug ? For example I have my wordpress site url as http://example.com/. I want to generate a page based on the slug provided on the url. This is a ...
1
vote
1answer
44 views

Does rename of page slugs create 301 redirects from old slug to new (same as for posts)?

Does rename of page slugs create 301 redirects from old slug to new (same as for posts)? Starting a fresh install of wp wordpress:4.9.4-php7.1 I'm trying to get automatic redirects for renamed page ...
0
votes
1answer
13 views

Change the full slug for a specific category?

I have multiples categories on my post: /category/blog /category/sports …And so on. I also have /category/news I'd like to change this category url to simply have /news without the /category. How ...
0
votes
0answers
17 views

Have different Post Archive Slug to Post slug?

I have 2 Custom Post Types in 1 archive page. $args = array( 'post_type' => array( 'event', 'news' ) Page works fine, both CPTs link to there correct posts. I want my archive slug to be '...
0
votes
0answers
54 views

Using %postname% permalink structure on posts with no title to not append -2

My Permalink structure uses just /%postname%/. When I publish a new blog post, it looks like: https://example.com/slug-goes-here I want to keep this structure as I prefer it for both pages and posts....
0
votes
1answer
10 views

Wordpress numeric (yearly) page names / disable yearly archives

I need to achieve page structures on website that is http://pagename.example/2017, http://pagename.example/2018 .. etc Now wordpress rename my page slugs to 2017-2, 2018-2 because WP use those ...
0
votes
0answers
24 views

Can't use Persian/Farsi in Author slug (returns 404)

I have modified author links to show nickname instead of username, using this tutorial. It works correctly with English names, but when I use Persian, it returns a 404. What's wrong? I've also tried ...
0
votes
1answer
24 views

WordPress Reserved Terms, any workaround?

I noticed that "embed" is part of "reserved terms" so it automatically change my slug in embed-2. There is any solution to force it to "embed"?
0
votes
1answer
55 views

Exclude a category slug on pagination

I'm a beginner of wordpress ... I'm creating my first template and I would like to exclude the category "portfolio" from pagination. I tried in every way, but I managed to do just the opposite, browse ...
0
votes
0answers
28 views

fix slugs containing invalid characters?

On a site I support, there are a lot of urls containing seemingly invalid characters (e.g. brackets, commas etc) which cause 404s in Google. e.g. http://www.anorak.co.uk/167259/news/those_who_cant,...
0
votes
0answers
8 views

how to change slug name without affecting the post items

I have facing a issue in slug name. I have replaced a taxonomy Testimonial into Products.I forget to replace the slug name of the existing one. which is testimonial-view. now the url of the product(...
0
votes
1answer
37 views

add .html to custom post type with WPML

( i open a new question since i found why my slug don't translate in generated links, sorry if it is an error, but sounds logical for me ). so i use WPML and Custom Posts Type on my wordpress. i ...
0
votes
3answers
89 views

How do I get slug of all active plugins programmatically?

I want to check plugin version using following API https://api.wordpress.org/stats/plugin/1.0/{slug} For that how can I get Slug of All Active Plugins ?
0
votes
0answers
137 views

Divi change project slug based on category

My first help-question here :) Using Divi theme, i found that Project custom post type let you add your portfolio projects, while having PROJECT slug in the URL. The web is full of tutorial about ...
0
votes
1answer
50 views

Automatically update slug with latest title within custom post type [duplicate]

I'm trying to update the slug for all the post within a specific custom post type, let's say "music". Here is the code: /* Update slug with the latest post title */ function auto_update_post_slug($...
1
vote
1answer
78 views

Using page slug in array

I want to use the page slug as the taxonomy when calling a list of custom posts. This works: <?php $page_slug = basename(get_permalink()); ?> <?php echo $page_slug; ?> It shows "...
0
votes
2answers
56 views

generate random slug when adding taxonomy

I have created a custom post type called 'reports' to provide an easy method for providing monthly reports to specific people. I don't want users to have to login to view the reports and I also don't ...
1
vote
1answer
537 views

Custom Post type & Taxonomy URL structure

I have a custom post type products and a custom taxonomy 'Product Categories' with the slug products. My goal: I'm trying to create a URL structure like so: Product Post Type Archive: products/ ...
0
votes
0answers
32 views

Controlling URLs structure per category, tag and slug

New to WordPress, I'm trying to ensure posts URLs remain under their category slug. The blog I'm working on has multiple top-level categories (coding, fitness, lifestyle) as well as tags for each ...
0
votes
0answers
33 views

How to fix messed non-unique slugs?

I need some help finding my way out of some post slug messiness. As a result of some tweaks, I am now getting duplicate slugs and weird behaviour for posts with identical headlines... Background: My ...
0
votes
1answer
31 views

Slug Confusion Between Post and Custom Post types?

So I have a custom post type "Testimonial" and it's got some...interesting...behaviors. Last night, I had that type running and had created two testimonials, one of which was titled "James Blackwood."...
0
votes
0answers
21 views

Missing Form action Wordpress 4.2-->4.9.4

Since I don't know very much about wordpress I have to ask. How does WP handle the form actions? All form submits fails without any error messages it, the same site just returns as blank and the ...
1
vote
0answers
110 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 ...
0
votes
1answer
20 views

Get category from slug list

I've a list of url's and I want to get the categories of each one. Whats the best way to achieve this? Thanks. Diego
0
votes
0answers
99 views

How to customize the base slug for custom post type categories?

I'm setting up a custom post type "article" with base slug /articles and I'd like to add a category taxonomy to go along with it. The categories will be "nutrition", "lifestyle", etc. I'd like to ...
1
vote
0answers
20 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 ...
0
votes
0answers
10 views

Duplicate Slug on profile extensions

Using Symposium Pro plugin on Divine theme (paid) to create a forum. When using profile extensions to create custom profiles, the extension pages are all created with identical slugs ( "wps_extension" ...
2
votes
2answers
623 views

Remove Slug from Custom Post Type results in 404

I am working on a plugin that creates lists. After creating a list, I wanted to remove the slug from the url Post type: $rewrite = [ 'slug' => 'single-link', 'with_front' =&...
1
vote
1answer
36 views

Do post_names have to be unique?

I'm not 100% sure about this, so I'm asking: Does a post's post_name (aka: a post slug) have to be unique? Do they also have to be unique if each post has a different post type (a post and an ...