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
1answer
16 views

How to prevent WordPress from redirecting single page to prefixed category archive with same name?

I have been trying to solve this problem for hours. I would like to have a page with a simple slug (/blog) and a category term with the same name (/category/blog) exist on my site together at the same ...
0
votes
0answers
6 views

Creating sub-slugs without actual parent page

I would like to create individual pages for each member within a team: http://www.example.com/team/person-a http://www.example.com/team/person-b In the navigation menu I provide a parent entry ...
0
votes
0answers
19 views

Multiple slugs for one taxonomy?

I currently have a taxonomy registered with slug moods. So I access the terms with mydomain.com/moods/happy. I also want to access this with mydomain.com/tags/happy. I don't want to redirect. I want ...
0
votes
1answer
14 views

Rewrite/Change custom taxonomy slug

I want this url: => mydomain.com/genre/chant to be rewritten as => mydomain.com/chambers/chant. I want the users to access mydomain.com/chambers/chant instead of mydomain.com/genre/chant. genre ...
0
votes
0answers
9 views

How to set custom slug for core post type “post” and core taxonomy “category”?

I am looking for solution to set specific slug for posts and categories. I have default post type and taxonomies (category, tags). Permalink settings - "/%category%/%postname%/" I need ...
0
votes
1answer
12 views

page-slug.php not working but only for specific slug

I'm trying to create a page called "Comics" with the slug "comics" to use as the main table of contents for my webcomic site. I've created a page-comics.php file, however when I ...
4
votes
2answers
57 views

How to change default page slug?

I have a CPT called jobs and a page named Job Apply. I am trying to achieve something like below url: http://example.com/job-slug/apply Where, job-slug can be any job. i.e Programmer, Developer etc.. ...
0
votes
0answers
22 views

Why does updating permalink structure only update posts and not pages?

This might sound like a stupid question but I've honestly looked everywhere. Currently my WP Page structure is {site-title}/{page-title}. This works fine, however I want to change the permalink ...
0
votes
0answers
13 views

Get postID from custom permalink using slug

I'm trying to get the postID of from the URL of articles. I'm using the WordPress REST API to try and do it: https://yas.com.hk/blog/wp-json/wp/v2/posts?slug=someSlugHere When i try grabbing the slug ...
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. ...
0
votes
0answers
7 views

Edit with elementor not working!

i use elemetor based theme and now the edit with elementor option doesn't work. But when i change the slug of the page it will work. but within the old slug it will not. what is the issue? anyone ...
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 ...
0
votes
0answers
16 views

How to prefix `attachment` permalinks with `attachment`?

Could you please help me to prefix attachment permalinks with a custom string (for example attachment) Such that example.com/attachment-slug becomes example.com/attachment/slug? Apply only to posts ...
0
votes
0answers
15 views

Alter post slug by a filter that is fired just after a post is created

) I found (for example in Set default (auto) slug prefix for Tags) that it is possible for example add my-taxonomy prefix in front of all taxonomy slugs (permalinks). The post is outdated now since ...
0
votes
0answers
18 views

How Can I Create a Friendly Slug for a Dynamic Page?

I built a dynamic page template that pulls biography information from a MySQL table. The page works fine but the URL is ugly. Officer-Biography/?ID=1 I have a set of canonical slugs that I want to use ...
0
votes
0answers
29 views

Code snippet to add filter pre_post_link to change Media URL (post_type attachment permalink/slug)

I found a very good code snippet to add a "base" into URL of blog posts: Custom permalink structure with a prefix just for posts I tested it and it works great for post_type: post (to test ...
0
votes
0answers
9 views

Get The Most Recent Post of a Specific Term From Current Post

I'm developing a website for a webcomic and I'm having problems getting the page system to work. I have a custom post type set up for comic pages, and the pages are organized into volumes (with ...
0
votes
1answer
62 views

Removing old_slug and old_date from WordPress Database

I am trying to clean my database. In the wp_postmeta table I see thousands of _wp_old_slug rows. I am not concerned about these old links not being redirected. What are the pros and cons of removing ...
0
votes
0answers
18 views

Translation of page slugs using code

I've translated my website using translatepres plugin. I now need to translate all the page slugs like from site.com/se/contact/ to site.com/se/kontakt/ Please provide some useful funtion or hook to ...
0
votes
1answer
12 views

A way to export slug as meta tag

Is there's a standard way to expose post slug as meta tag, so it appears in HTML as say <meta name="slug" content="my-article-123">?
1
vote
1answer
34 views

How to query for pages/post depending on slug?

I work on a blog that contains both English and Romanian posts. I made the site bilingual by prefixing the slug of every article with ro- and en-. It is a simple way and it works pretty well. Now I ...
0
votes
0answers
20 views

multisite 404 subfolder same name slug as site

To keep this short, as a disclaimer, I'm not that versed with WordPress, servers, etc, so I might talk gibberish: The Issue 🠺 I have a multisite root, let's call it msite.com 🠺 This site spawns ...
0
votes
0answers
12 views

How to add filter to post_name just for a CPT

I was seeing this post on how to add a filter that allows adding dots to post_name. I made a change to use only dots. I want to make it work only for one type of CPT. But I don't know how to check ...
0
votes
1answer
16 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
65 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
0answers
16 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
51 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
26 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
26 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-...
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 ...
0
votes
2answers
27 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
0answers
42 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 ...
0
votes
0answers
63 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
24 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
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 ...
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
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
61 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 ...
0
votes
1answer
47 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
22 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
21 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->...
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
0answers
19 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. ...
0
votes
0answers
84 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 ...
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" ...
0
votes
0answers
14 views

Removed slug from custom post type URLs page template issues

I use this function Remove slug from custom post type post URLs to remove slug from custom post type URLs .. but now I have issues... page.php is not working ... so now my pages with default template ...
0
votes
1answer
62 views

List taxonomy term slugs within shortcode (do_shortcode)

I'd like to list the taxonomy terms within my shortcode. This is how I get the list of terms (separated by commas): <?php $terms = get_the_terms( $post->ID , array( 'shoptype' ) ); ...
2
votes
1answer
243 views

Post slug changed using code doesn't reflect on editor when post is published

I've a CPT (lets say Event) with a custom date field (start_date). I'm trying to generate the post slug (post_name) as start_date + post_title (separated by -). I've tried using the filter ...

1
2 3 4 5
14