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

Questions tagged [slug]

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

0
votes
0answers
12 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 ...
-3
votes
0answers
39 views

New WP update - Terrible new editor [closed]

This new editor update is terrible. I cannot find where to change both title and slug of a new page. Some info are best left simple! Other editors are so good WP cannot beat them, especially when ...
0
votes
0answers
8 views

BBPress Change & Disable Slug [closed]

Q1: How can I change slug of these parts For example: domain.com/forums/forum/testingforum/ to domain.com/forums/forum-testingforum/ Which means I want the slug to show as domain.com/forums/forum-%...
0
votes
0answers
12 views

wordpress user profile url/slug problem after import

0 down vote favorite I am using a wordpress theme and in this theme there are an import user option. Also I changed user's slug with a plugin that named Edit Author Slug. After I import users by ...
0
votes
0answers
14 views

Attachment page slug changed after editing permalinks

We run into a little problem, we are using the YOAST seo plugin that redirects the attachment page to the attachment it self. All cool. But after we change the permalinks from %postname% to %category%...
0
votes
0answers
15 views

Display category name without echoing data type

Good afternoon everyone, I have written a loop for a custom post type that displays the image of 1st post of each category $args = array( 'hide_empty' => 1, '...
1
vote
1answer
35 views

WordPress custom slug (endpoint) and compare all links

I work on the one i18n function. It will work with subdir. For example: eg.com/hello-world/en For this I'm support EP_ALL for the WP custom endpoints. function lang_add_endpoints(){ ...
0
votes
0answers
18 views

How to prevent WordPress from creating permalinks for media files

Can you please explain how can I prevent WordPress 4.9 from creating permalinks / slugs for Media files without installing a plugin? It is also important that the solution will not be overwritten by ...
0
votes
1answer
15 views

Custom post type with slug for plural (archive) and for single

I've been searching a way to have kind of "two" slugs for a custom post, let me give an example: www.mywebsite.com/articles/ or www.mywebsite.com/articles/page/2/ for the archive www.mywebsite.com/...
0
votes
1answer
40 views

How to allow different authors to use same post slug?

We have a multi-author WordPress site where different authors need the ability to use the same slug (post_name). Right now WordPress will append a -2 to the slug but how can we prevent WordPress from ...
0
votes
1answer
25 views

Output all terms slugs for a loop filter

I have created a filter on a custom post type loop using terms slugs just like that : <li><a href="#" data-filter=".<?php echo esc_attr( $cat->slug ); ?>"><?php echo esc_html( ...
1
vote
1answer
31 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 & ...
0
votes
0answers
31 views

Amp Remove Custom Post Type Slug

I'm trying to figure out this problem: first of all, I added a custom post type to my theme and I removed the slug of cpt (so the url was "https://siteurl/recipe/post-name" and now it is "https://...
1
vote
0answers
20 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 ...
0
votes
1answer
16 views

how do prevent wordpress from creating permalinks for media files

Could one please explain how can I prevent WordPress 4.9 from creating permalinks/slugs for Media files without the need of installing another plugin? It's also important that the solution won't get ...
1
vote
1answer
26 views

How to get the post name (slug) from the item ID when traversing the navbar?

I'm working on a filter for nav menu items, such as add_filter('wp_get_nav_menu_items','nav_items', 11, 3); function nav_items($items, $menu, $args) { foreach ($items as $item) { $slug_1 =...
0
votes
0answers
32 views

Unable to replace custom post_type slug by the publish_post. But the save_post is working properly (wp_update_post)

I would like to update the_title when saving the events every time. And the slug when publish new events only. <?php function set_title_on_save( $post_id ) { $post_type = get_post_type($...
0
votes
1answer
33 views

Removing CPT slug from URL results in 404 error for archive page

I have created a CPT with rewrite rules as follows: "rewrite" => array( "slug" => "/", "with_front" => false ), In the functions.php, I have added the following code: function ...
1
vote
1answer
52 views

Taxonomy page returns 404 page not found

I have a custom post type and one custom taxonomy registered for it. The custom post type is called "memory-cards" and the taxonomy is "lesson".For this taxonomy I have create two terms "english" and ...
0
votes
1answer
33 views

I've removed my /author/ slug but it clashes with new and existing pages. Any fixes?

I've successfully removed my author slug using this tutorial: https://wp-snippet.com/snippets/remove-author-prefix-from-slug/ so it's like website.com/author/cixxy to website.com/cixxy My question ...
0
votes
1answer
31 views

Display a custom slug in URL depending on user variable

Sorry if this has been asked - I haven't figured out how to search it in a way that leads me where I want to go. We have a client who wants a site built that represents four geographical areas and so ...
3
votes
1answer
140 views

How do I use the same post slug for different Categories?

I want to use the same post slug for different categories. Because I will have different projects with the same slug. I already have the post slug email. The second slug email becomes email-2, but I ...
0
votes
1answer
71 views

how to get category`s slug in WP_Query loop?

i use below code : //custom post = project //taxonomy = project-category $args = array( 'post_type' => 'project', ); $query = new WP_Query( $args ); // The Loop if ( $query->have_posts() )...
1
vote
1answer
25 views

How to show posts with multiple tags on tag.php?

On my tag.php page, I want to show posts with multiple tags... I have something like this: mypage.com/tag/tag1+tag2+tag3/ $tags = get_queried_object()->slug; //returns only 'tag1' !! $args =...
2
votes
3answers
53 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/...
3
votes
2answers
101 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
28 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
72 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
37 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
226 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
76 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
17 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 ...
1
vote
1answer
487 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
33 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
599 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
166 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
25 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
63 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
55 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
532 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
155 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
74 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
27 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
17 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
133 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
14 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
27 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 '...