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
0answers
8 views

Set page title based on slug and not page ID in Wordpress and RankMath

I have a custom theme. There is a template for all products (and main product page uses same template). So: mysite.com/products = post id = 12 mysite.com/products/product1 = post id = 12 Current ...
0
votes
2answers
208 views

Yoast SEO breadcrumbs: how to create a filter that uses the url slug for breadcrumb titles

I know we can manually edit the breadcrumb title for a page or post using Yoast SEO's breadcrumb functionality. But with thousands of posts and pages on an existing site this isn't desirable. My ...
0
votes
1answer
55 views

Restrict admin access to certain pages based on page slug

I'm trying to do exactly what is done with this question - Restrict admin access to certain pages for certain users Except I want to use a page slug to restrict the users by. So instead of $query-&...
0
votes
1answer
3 views

Migrated WP with Arabic categories/posts now fail when link is clicked but refreshing the page works [closed]

I migrated a WP where the posts are in Arabic, and now if I click to open a post chrome makes a request to its percentage equivalent and fails, but hitting the link directly from the address bar works....
0
votes
1answer
10 views

Adding language based URL structure

I'm working on a multilingual site. I already have content. I need to arrange my pages based on the language by adding a language code before page name, like: my-we-site.com/en/contact my-we-site.com/...
0
votes
1answer
753 views

Change custom post type slug from plugin options

I'd like to give users the option to change a custom post type slug in my plugin. Using this answer, I'm able to hardcode it into a function: Redeclare/Change Slug of a Plugin's Custom Post Type ...
6
votes
4answers
21k views

Using custom/dynamic “slug” for a page

I have a custom page which uses a template called "Stores" http://example.com/stores/. This page will have a list of states and/or companies as categories. For this system I have a custom post type "...
0
votes
0answers
12 views

Rewrite rule not working, but only when parameter is text

I have a simple rewrite rule that changes something like /locations/?slug=times-square to /locations/times-square/. The same "location" can be retrieved by ID, so the following URL's all work and ...
1
vote
2answers
41 views

How to target a specific custom post type post and its all children and grandchildren?

I will really appreciate your help to create a function that will check by a given $my_custom_post_type_name and $post_name and return true if the current page / post is a $post_name or $...
0
votes
2answers
21 views

Retrieving Tag Name in Template Part from Filtered URL

WooCommerce has a built in product_tag url filter as such: https://my-url.com/my-page/?product_tag=my-slug Bringing back all the product_tags with the given slug in the url. I am trying to do ...
0
votes
0answers
22 views

WP Slug Customization gives Error 404 / Not found (PODs Custom Post Types)

I am using PODs custom post type and I have created bi-relatation between two post types. My idea is to get a custom slug when there is a relation between two custom post types like: /custom-post-...
2
votes
3answers
6k views

WP appending -2 to the end of my slug. Where are the originals stored so I can delete them?

I've been learning about taxonomies, custom posts etc though a lot of trial and error. I finally have it working how I want, however now I am getting some conflict with my desired slugs. I can't name ...
25
votes
3answers
86k views

How to get a taxonomy term name by the slug?

If I know a taxonomy term slug, how can I get that term's name?
0
votes
2answers
622 views

Why does post-slug not get saved for drafts?

I am trying to get the value of the 'new-post-slug' (the bit that you can edit to customize your slug for a post, but bizarrely doesn't have a 'name' attribute as you'd expect a form field to have ... ...
1
vote
0answers
14 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 ...
5
votes
2answers
6k 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
2answers
24 views

Difference between a default post type and a custom post type?

I'm a new user of WP, i have create 6 customs post type where i can change parameters of them in the functions.php of my personnal theme. I can change 'supports' and 'slug'. On my url if i put my cpt ...
0
votes
1answer
468 views

post_name is not stored until post is published… where should I store my slug until it goes live then?

important try as normal contributor user, not as admin see here I actually have it reproduced. Seems like a bug to me but whatever. I want users to choose their slug. Well, as you cannot store ...
17
votes
6answers
19k views

Theme localization of “slugs” (custom post types, taxonomies)

in my theme I want to define a series of custom post types and custom taxonomies, each one having its own customized slug; the base language of my theme is english, therefore the slugs will be in ...
1
vote
1answer
4k views

remove custom taxonomy base / slug [duplicate]

Possible Duplicate: Remove slug in taxonomy url I'm using proreview theme and it uses a custom taxonomy called "review-cats" In of this www.domain.com/review-cats/clothing I want www.domain....
0
votes
1answer
596 views

How to change parent permalink?

I have a theme with hardcoded permalink structure for some posts. Those posts open with site.com/parent/page structure. I created a filter that replaces the link from "site.com/parent/page" to "...
0
votes
0answers
27 views

How do I use the same Tag slug for different Tags?

I want to use the same Tag slug for different Tags. My URL structure will be unique basing on the category, but post_name and post_tag may happen to be duplicate in some cases. I need this for good ...
2
votes
1answer
1k 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 ...
0
votes
1answer
43 views

How can I write slugs / permalinks as: custom post type -> custom taxonomy and custom post type -> custom taxonomy (one CPT and many taxo)?

This is my first post, so maybe I'll miss some informations, sorry :bowing. I have almost the same issue as Paul T did (Permalinks: custom post type -> custom taxonomy -> post), namely : I ...
0
votes
0answers
21 views

How to use current post ID in pods single value widget?

How can I get the current post slug (or ID) to view a simple pods field in a widget? I really can't find a way to do it. In the single field pods widget there are 4 fields: Title (I can leave it ...
1
vote
1answer
19 views

Need to pull parent category and slug - only pulling daughter category

I am tweaking a theme for my friend, and I am using the following: <?php $category = get_the_category(); ?> <h3 class="omc-blog-two-cat"><a href="<?php echo home_url(); echo ('/...
1
vote
1answer
36 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 ...
0
votes
1answer
15 views

Swap out a page that is a parent to a many many pages

I have a specific page on my site and I'm experimenting with some changes that are too complex to have a backup (page template change, custom fields etc). I duplicated the page using a plugin and ...
0
votes
1answer
494 views

Rewriting archive page slug to be different than custom post type slug

I am having trouble changing the slug of my archive page. The goal is to create a page that can be edited from the back end of WP with the slug speakers, but that has already been taken by the archive ...
0
votes
1answer
15 views

my post slug gets really long and I can't change it

my page url works, when I type in a slug, whith my focus keyword (using yoast) it changes it aotumatically when I click out of it to some code (%d7%a7%d7%99%d7%93%d7%95%d7%9d-%d7%9e%d7%a0%d7%a6%d7%97) ...
0
votes
1answer
48 views

Remove custom taxonamy slug with pagination

I have added the custom taxonamy for my faq site. I want to remove the default custom taxonamy showing in url for archive page. I have tried some codes, but it's break my pagination. function ...
1
vote
1answer
704 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://...
2
votes
2answers
3k views

How to add dot(“.”) in post slug

How to add dot(.) in post slugs? In our blog, we are writing about websites and would like to use their exact address as slug like this: ourdomain.com/example1.com But dots are either removed when ...
1
vote
2answers
562 views

Custom Taxonomy breaking pages permalinks

I'm stuck for some days with this problem and I don't know what else to do. With %somethingHere% on slug rewrite, pages permalinks are broken (CPT AND CT OK). Without, I don't have my desired Post ...
0
votes
1answer
607 views

Category slug not showing for Custom Post Type

I have a Custom Post Type called 'shows' which makes use of the default Wordpress Category function. I can see my 'shows' posts on /category/%postname% URL's, but when I post the URL the slug looks ...
0
votes
1answer
652 views

WP Database generate content for post_name column

I ran a query that deleted all content in post_name (used for SEO-friendly URLs) column. UPDATE wp_posts SET post_name = '' I thought that WordPress would automatically populate new ones if I update ...
0
votes
1answer
1k 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
0answers
12 views

How can I use same post slug while posts are in different categories?

Example1: www.site.site/category1/abcd-slug/ Example2: www.site.site/category2/abcd-slug/ Wordpress auto adds same number end of the slug of example2. www.site.site/category1/abcd-slug-2/ But I need ...
0
votes
0answers
19 views

wp_nav_menu slug in before item

how i can place menu item slug on before items like this: wp_nav_menu(array( "theme_location" => "mymenu", "menu_class" => "mymenu", "before_item" => "<span>$item->...
12
votes
8answers
14k views

How can I find plugins' slug?

I'm wondering how can I find plugins' slug (slug = internal name used by WordPress to do plugin updates and to determine which plugins are currently active)? It is usually plugin's folder name but if ...
0
votes
0answers
15 views

permalinks / slugs

This is the first site I have had a problem with the page name not showing up in the domain page name. Like https://imaginedesigns.ca/?page_id=11 is the permalink that shows but my slug shows 'about' ...
0
votes
2answers
990 views

Is there a way to remove the option to modify the Slug in post.php

I am trying to remove the option to edit the Permalink. I know how to hide it with CSS and I have. But a hacker could simply just go to Inspect Element and change display: none; to display: block; ...
0
votes
0answers
17 views

Use taxonomy term in custom post url, not the taxonomy slug

I want to use the taxonomy term in my custom post url, but not the taxonomy slug and can't figure it out. Here's what I have so far. I have a custom post type articles and a custom taxonomy sections. ...
5
votes
1answer
845 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 ...
0
votes
1answer
331 views

Is this the correct way to add post-slug input field?

I added slug input field in my custom post type and allow users to edit it at front end. Then, when insert post, I use this: $wp_insert_post_args = array( 'post_status' => 'publish', ...
0
votes
1answer
1k views

Why is there /index.php/ in all my links? How do I remove it?

I recently realized that my rss feed is not working, because a plugin was assuming it's under mydomain.com/feed But it isn't. I get an 404 error. I figured out that instead my feed is under ...
0
votes
2answers
752 views

Add category slug as class attribute in a link array

This incredible website and the genius developers here have helped me significantly in the course of my WP Dev over the years, firstly THANK YOU. I am now faced with a problem that I have been trying ...
0
votes
0answers
58 views

Proper way to dynamically load content based on url slug Wordpress

I am trying to set up a page template that can dynamically load content to the page based on the url slug. For example: https://example.com/cities/indianapolis/ loads data specific to Indianapolis and ...
0
votes
1answer
33 views

How to ignore GET parameter that’s the same as a CPT slug?

I have a custom post type called newsletter. At the same time, an implemented analytics tool (not related to my CPT) uses newsletter as a GET parameter to track some incoming links (and I can’t change ...
0
votes
1answer
1k views

Create “/blog” sub-site on WP multisite network

I've had a site for a few years that till yesterday consisted of two WP 3.2.1 installations- one for the main site and one for the blog, which had a different theme and was located at [site.com]/blog. ...

1
2 3 4 5
13