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
1
vote
0answers
17 views

Remove the parent slug in a CPT URL

Here is the code that I insert in my functions.php to remove the slug of a CPT present in the URL : /** * Remove the custom post type slug from URL */ function wpc_remove_cpt_slug($...
0
votes
0answers
6 views

Post slug cannot be edited after add add_rewrite_rule

Because I wanted to add a blog reference to the slug of each post, I add a add_rewrite_rule. But now the slug can not be edited on the dashboard. How can I make the slug editable? my dashbord: my ...
0
votes
1answer
18 views

How to delete a post and keep its slug to refer to another post

I've 2 almost identical posts: https://webscraping.pro/reliable-open-proxies-for-business-directories-scrape/ https://webscraping.pro/reliable-rotating-proxies-for-business-directories-scrape/ I ...
0
votes
0answers
14 views

Custom Slug in Custom Post Types and Custom Taxonomies

We never ever get into this situation because I will never use custom post types in a blog article website. But, because SEO and Analytics we need to change this. this my example: $postTypeName = '...
0
votes
0answers
11 views

How to create such URL structure for CPT with custom taxonomy

I have a CPT - Market (eg Footlocker) And I have a taxonomy - Countries But countries are divided into regions, so they look like a subcategory ( Europe - France, Germany, etc) I want to get a URL ...
0
votes
0answers
9 views

Slug duplicates once clicking on link

I'm using polylang plugin. I have the current URL http://localhost/wordpress/en/ in my browser, I have another URL that suppose to change language to Hebrew http://localhost/wordpress/he/. <a href=...
0
votes
1answer
12 views

Attachment pages stealing page slugs

I'm working on remaking a big website with its upload folder already full of many gigabits of images. I just noticed a problem I never noticed with WordPress before: it seems to create attachment ...
0
votes
0answers
14 views

Does single webpage do not need navigation to create a slug in permalink?

I have concern about the permalink in my working project do i need to create a slug for the permalink in navigation. Your answer will highly appreciated. Someone help me stock in
1
vote
0answers
25 views

Permalink for a custom post type isn't working and I don't know why

I think this question was answered a lot, but despite all threads I couldn't find a valid answer: I'm working on a website with Wordpress (and without any plugin). Here the creation of my custom post ...
0
votes
0answers
21 views

When I modify the product's permalink, the pages stop working

I'm trying to modify the Woocommerce slugs with the object $wp_rewrite. When I modify it, everything works as I put it, but the rest as the pages stop working. Here the code: public function rewrite():...
1
vote
1answer
39 views

Change default search URL slug in wordpress with Custop Post Type as Search target

I want to change default search page URL from: http://example.com/?s=background&post_type=download to: http://example.com/photos/background/ I tried to change the below function for the default ...
0
votes
0answers
12 views

Page Titles and Slugs get deleted

I have a strange issue with my wordpress website. It doesn't save post/page titles. Has anyone faced a similar issue before? Each time when I create a new post or a page and put a title - it gets ...
0
votes
1answer
18 views

Adding a custom field to a slug

I'm using the WP Job Manager plugin, and want to add the company name field to the slug automatically when I save a post. I've got it working using the code below, but once I save and then edit the ...
0
votes
0answers
12 views

How might I disable the slug edit button for any post that has ever been published?

I want to disable the slug-edit (my permalinks) button on post.php for any post that has ever been published, which includes posts that were once published and then unpublished. However, after having ...
0
votes
1answer
25 views

Disable WordPress from changing URL slug when post is published

We have post titles that contain emojis. While creating a post and saving it as a draft, the URL slug generated by WordPress doesn't add the [emoji] from the title. However, when the post is published,...
0
votes
1answer
19 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
8 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
34 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
15 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
10 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
16 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
60 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
26 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
11 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
37 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
24 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
17 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
20 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
52 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
98 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
13 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
43 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
25 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
15 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
30 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
73 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
24 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
62 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
27 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
31 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
37 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
50 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
152 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
29 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
49 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
2 3 4 5
14