Questions tagged [url-rewriting]

Refers to the process whereby an URL is manipulated to create what in WordPress is called a "pretty permalink"

Filter by
Sorted by
Tagged with
0
votes
0answers
27 views

Custom post type change permalink query

My permalink rules are set to post name. I created a custom post type named: house. The default url would be: {{site_url}}/house/{{house_slug}} Then if I print the query in the pre_get_posts action I ...
0
votes
0answers
13 views

add_rewrite_rule to load different page, without changing URL in browser

I need a function(s) where I load to 1 specific page (index.php?p=49) whenever a URL is written with an all numeric slug/end. However, the written URL has to remain the same in the browser as it ...
0
votes
0answers
10 views

rewrite based slug standar post wp

I want to create based slug for default post type wordpress based on query var lang. for lang=en my url want to be https://domain.com/articles/{post-name} for lang=nl my url want to be https://domain....
0
votes
0answers
13 views

wordpress path generation from rewrite rule

I have set a custom rewrite rule. The url gets parsed and loads the correct page. When the same page is added in the menu editor, it does not generates the different path. I want that my same rewrite ...
0
votes
0answers
13 views

multiple URLS for the same page

I have an archive page set up for a custom post type, which displays all the posts. When you click on a post, it opens a modal with more information. So as it is now, there is a single url: https://...
0
votes
1answer
7 views

How to allow WordPress to recognize a custom URL segment after a product URL and use a custom template?

Essentially I'm trying to allow a URL like this: https://example.com/products/my-product/test I'm using WooCommerce, my product base is /products, and the product name would be My Product here. I want ...
0
votes
1answer
11 views

Rewrite with pagination /foo/page/2/ to posts of a given category, page 2

This add_action('init', function() { add_rewrite_rule('^foo', 'index.php?category_name=category1', 'top'); }); works and allows example.com/foo/ to display all the posts from category1. But then ...
1
vote
0answers
13 views

How to preserve the query string while using add_rewrite_rule and default public query vars

I have a single page application embedded in a WordPress website. I'm able to redirect back to that page with a rewrite that matches the page slug as a base: add_rewrite_rule( '^showroom/?', 'index....
1
vote
0answers
9 views

Taxonomy custom post type URL

I have created a custom post of type "job". I created taxonomies. I would like the urls to be done like this. examplesite.com/job/categorie/page because for the moment in the url there is ...
0
votes
0answers
12 views

404 error rewrite permalinks

I have a issue with my rewrite url and I hope somebody can help me out. add_action('init', 'my_custom_rewrite'); function my_custom_rewrite() { add_permastruct('catalog', '/%customname%/', true);...
0
votes
0answers
14 views

Custom route and extract data from slashes and parameter

some external website is going to send a specific data into a WordPress site and need to extract and process it. The data is coming trough URL (between slashes and as parameter): domain.com/login_sso/...
0
votes
1answer
26 views

I want to rewrite the URL of a specific post with a specific custom field to easily analyze in Google Analytics

Our Wordpress website has a custom post type named "life". For each "life" post , A specific custom field value "special" (true | false) is set. I want to rewrite the URL ...
0
votes
0answers
18 views

Rewrite URL for CPT to domain/post-name/post-id

I am struggling with the rewrite function from Wordpress. I have a custom post type named "catalog". Every post has the permalink domain/post-type/post-name and I will change this to domain/...
0
votes
0answers
19 views

Custom post type rewrite with categories and static pages

I am confused in wordpress with rewrite and categories and static pages with the same name as categories have. I build a custom post type called "products" and have product_categories like &...
1
vote
0answers
14 views

One Specific Category To Permalink

I have a Wordpress site that has been up and running for some years using the custom permalink structure of: /%postname%/ This is fine, except I want to launch a special section in which posts go in a ...
0
votes
0answers
15 views

Test the existence of a page/article by its URL, taking in consideration the URL rewriting by filters

I have this line in functions.php: add_filter('post_link', function($link, $post) { return str_replace('foo-', 'foo/', $link); }, 10, 2); and now Wordpress successfully sees example.com/foo/bar as ...
0
votes
1answer
23 views

Custom folder with PDF files (not in WP Library) - Create url for each file

I have a folder mywebsite.com/wp-content/customUploads which contains hundreds of pdf files. At this point the url to see a pdf file is for example: mywebsite.com/wp-content/customUploads/myfile.pdf ...
0
votes
1answer
22 views

A different permalink structure for different categories

My Settings > Permalinks is set to /%category%/%postname%/. Thus blog posts have URLs like example.com/category12/article1. I would like to keep this permalink structure for most articles. Which ...
0
votes
1answer
35 views

Share root slug for Child Page and Custom Post Type (prioritizing child pages over posts)

Let's suppose a Custom Post Type called "Whatever", which will have a root slug set to "whatever". This makes all posts of type "whatever" be available at site.url/...
0
votes
1answer
18 views

Custom rewrite rule based on other custom post type title

I am trying to change url of one custom posts type based on name of the other one. To achieve this. first custom post /test1/aaa the other custom posts aftere rewrite /test1/aaa/123 /test1/aaa/456 /...
1
vote
0answers
33 views

Force wordpress to display page with same url structure as categories

I'm struggling with Wordpress url structure... My page for posts is domain.com/resources My category url structure is domain.com/resources/[cat-slug] (I changed the category base in the WP permalink ...
0
votes
0answers
21 views

add_rewrite_rule() issue with parent/child/child page

I have a parent/child and another parent/child/child pages. I have 2 separate page templates for both pages and the following add_rewrite_rule() code in place: add_rewrite_rule( '^user/dashboard/([^/]*...
0
votes
1answer
12 views

add_rewrite_rule with optional parameters

Using add_rewrite_rule() to handle things like this for the custom post type "catalogs", page name "cars": /catalogs/cars/ /catalogs/cars/p1/ /catalogs/cars/p1/p2/ /catalogs/cars/...
0
votes
1answer
26 views

Wordpress is adding "category" word before my actual category name in url (and this is unsolicited)

Check out this image: This is twenty twenty theme, a default theme. I started facing the problem with a non-default theme, so I switched over to this other theme just for testing, same thing. What's ...
1
vote
1answer
20 views

add_rewrite_rule fro html to another url not working

I want to redirect mywebsite.com/anyname.html to mywebsite.com/product/anyname For that I write the following query in functions.php . But it is not working . Please see my code below function ...
2
votes
0answers
16 views

Newbie question: no index.php? in my plain wordpress permalink

I am trying to learn about the Rewrite API and I see people write their plain permalink as "index.php?page_id=", but my local Wordpress site shows "?page_id=" instead. Is there any ...
0
votes
0answers
24 views

Taxonomy URL rewrite whilst keeping filtered posts?

I'm trying to essentially filter Woocommerce products by looping through the terms and allowing the user to click the permalink which will take them to a page which filters the products based on what ...
0
votes
0answers
20 views

Wordpress rewrite with custom parameter doesn't work

I'm currently developing a plugin which takes a parameter from URL (example: example.com/product_id/1234 is converted to example.com) and passes it in WP_Query (supposedly this should be used instead ...
0
votes
1answer
39 views

URL structure for dynamic content broken since upgrade to 5.8

I have recently upgraded from wordpress 4.7 to 5.8 (I know a bit of a big jump). In the old version I could dynamically change the page content using the following url structure: example.local/courses/...
1
vote
0answers
33 views

How to change custom post type permalink structure

I have 2 Custom Post Type : article and multipager_article Now I want to customize permalink structure for these 2 custom post type only I want Structure like this : site_url/term_slug/post_id I ...
0
votes
0answers
26 views

How to change URL from /%postname%/ to custom-name/%category%/%year%/%monthnum%/%day%/%postname%/

I am trying to change our news media website permalink structure to more explanatory and useful link for our readers. We started wrong using just the Post name structure as we thought it would be best....
0
votes
0answers
18 views

Have unique URLs on the ad site

For some time now I have had a problem with an ad site that I am developing with wordpréss. I am unable to generate unique pages with the post id as in this example website: ... Acer-nitro-17-gtx-1650-...
0
votes
0answers
21 views

Redirect users with "." (dot) in their username and replace with "-" (dash) to correct profile

Im having problem with usernames that have '.' (dot) in their username and throwing 404 when try to access their profile page in front end. Can we replace this '.' (dot) with '-' (dash) because ...
0
votes
1answer
18 views

How to change search page url so that it still returns a page when there's no search query specified?

I want to change the search url of WordPress. Instead of url.com/?s=searchterm I want to change it to url.com/search/searchterm or url.com/search?s=searchterm. On Google there's plenty of solutions ...
4
votes
1answer
36 views

WordPress custom taxonomy URL rewrite on spelling errors

I have found myself in a situation which I would like to understand and ultimately fix. We have custom post types and for them, custom taxonomies. Everything is working fine. URLs a generated right. ...
1
vote
0answers
41 views

URLs and navigation in custom themes

I have created a custom theme for my site, using stand-alone PHP files (PHP files that are not associated with core, plugins or WordPress themes, eg index.php, header.php ...). In case anyone is ...
0
votes
0answers
20 views

404 for custom static link on IIS with URL Rewrite Module

I need to use IIS to develop the new WordPress site. After reading a lot of articles, I installed the URL Rewrite Module on IIS (https://www.iis.net/downloads/microsoft/url-rewrite). My site structure ...
0
votes
1answer
20 views

Point 404 pages to homepage

I would like to build a website where all page URLs point to the homepage. Wordpress already shows URLs like website.com/randomstring/ as a 404 page. However, instead of the 404 error, I would like ...
0
votes
0answers
17 views

Add www to the Root Site in WP Multisite Network

I have a WordPress (Latest version) based website with Multisite Network Enabled. For example, the domain is example.com. So, my root site is example.com and my subsite is blog.example.com. But I want ...
1
vote
0answers
14 views

Custom permalinks with hierarchical taxonomy - getting PHP warning

I have a site where a CPT needs to have permalink structure with custom taxonomies (parent and child). Following this solution https://wordpress.stackexchange.com/a/75172/210080 I got custom ...
1
vote
0answers
14 views

How do I display only the parent page in the url

My site is going to serve content that I want to keep hidden. It is set up like the example below. site.com/parentPage1/ChildPage1 site.com/parentPage1/ChildPage2 site.com/parentPage1/ChildPageN site....
0
votes
0answers
14 views

Help redirecting old blogger links

I'm in the process of moving 3 Blogger blogs to WordPress. I have a lot of links, but I don't need to have the date in the new link. So I want to use this format for links: /%postname%/ I want to get ...
0
votes
0answers
23 views

How to change url of specific posts with name of a root page

So my client site will be used for filling in a form to anticipate on neighborhood question from town councils. The homepage will be a town search page where you can type your town and go to a landing ...
0
votes
0answers
13 views

is this url structure/query possible with wordpress?

is it possible to have a wordpress filter products by tag via the URL as follows: ( this does not work ) /product-category/schools/?product-tag=testingtag Like this current one that is already in ...
0
votes
0answers
9 views

Google crawls site.com/my-category/0/page/* urls that are not supposed to exist

Google reported a schema error on a page on my website which should not exist: mysite.com/my-category/0/page/25 my-category does not have 25 pages. It only has 3 pages. I checked the other ...
0
votes
1answer
31 views

WP returns to domain root instead of siteurl

On various admin actions (e.g. delete a post), my fresh WP install (dev.mydomain.com/website) returns to the domain root (dev.mydomain.com) instead of dev.mydomain.com/website/wp-admin/edit.php?some-...
0
votes
0answers
17 views

Multisite problem with unexisting paths to CSS etc

I have the multisite Wordpress site: domain.com/siteA domain.com/siteB Now when the post is published on main site (domain.com), it looks fine because bunch of resources are OK path: https://domain....
0
votes
0answers
24 views

Hidden permalink different from displayed permalink

I am working on a website which I did not create on WordPress for a company and I am running into the following issue. Structure Category: fruits Sub-categories: red, yellow, orange Items: apples, ...
0
votes
1answer
28 views

Add prefix to url, but products not showing in page SHOP

I have managed to add a prefix in the url of my site, now my site allows entering the Shop page with these two urls: misitio.com/tienda and with the prefix: misitio.com/us/tienda When I enter with the ...
0
votes
0answers
18 views

Create different permalinks for same post

I am working on a website where we have blogposts. These blogposts have 2 custom taxonomies: subject and region. The permalink of a blogpost looks like this: /subject/blogpost-title my normal ...

1
2 3 4 5
40