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
1answer
9 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
23 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
16 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
15 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
22 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
19 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
28 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
28 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
21 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....
1
vote
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
20 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
14 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
33 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
40 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
19 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
19 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
12 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
29 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
16 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
23 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
27 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 ...
0
votes
0answers
35 views

Single pretty url query var parameter

I’ve registered a custom query var that I read from shortcodes running on a page ‘d’, so at the moment … [URL]/d/?v=value works. The page is essentially a template and the value is actually an author ...
0
votes
1answer
48 views

Combine multiple CPT names to create valid permalinks

I have three different Custom Post Types: Company Employee Project They are connected with ACF relationship fields so as the Company can have multiple Employees and each Employee can have a project ...
0
votes
0answers
19 views

Custom URL rewrite rules for a web app

I'm working on a wordpress install that functions more like a web application than a traditional website, and I'm trying to get my head around the add_rewrite_rule system. Currently I have three ...
0
votes
0answers
18 views

Pretty permalink issue wp_query not working properly

I have a custom post and taxonomy. So currently I have this mysite.com/products that show the archive. Next, I have this mysite.com/products/dairy-chilled-eggs(parent term)/ this will give me all the ...
1
vote
1answer
30 views

How to rewrite taxonomy and tags URL

example.com/wp-admin/edit-tags.php?taxonomy=fixed-tags&post_type=portfolio Please how can I rewrite: example.com/blog/fixed-tags/b2b-business-to-business to example.com/portfolio/{fixed-tag} - ...
0
votes
0answers
15 views

Show Pages for all Category Links but not for Childless Categories

i can rewrite Category base in Permalink Settings or use function wpa_alter_cat_links( $termlink, $term, $taxonomy ){ if( 'category' == $taxonomy && 0 == $term->parent ){ return ...
0
votes
0answers
14 views

Link Parent Category to Pages and last child category to category.php

I am trying to implement Silo Structure to my Page. I got usually 3 categories added to a post and I have set the permalinks to /%category%/%postname%/ I removed the /category/ base with "."...
0
votes
1answer
32 views

remove SLASH on single_post but KEEP on categories and parent pages

My current permalink structure is  /%category%/%postname%/  which produce urls as: (category_base removed using "FV Top Level Categories" Plugin) category: example.com/class-10/science/ ◀▬...
0
votes
1answer
20 views

url not using query string no longer working

I have a few websites where I have coded a custom feature to get data from the database, these are all older sites. the page fetches info by grabbing the last part of the url and turning it into the ...
0
votes
1answer
33 views

Page get parameter doesn't work with is_single() function

If exist the page parameter in the blog post, I have to redirect to the 404 page instead of current post URL. I tried to check the current page type (is singular) and try to get page parameter in the ...
1
vote
0answers
14 views

Change the permalink URL to include a taxonomy term

I'm brining 3 wordpress sites into one but our existing sites have good brand recognition in our field. So we have the main site which is sitemain.com and all articles that were there have been ...
0
votes
0answers
22 views

How to apply multiple rewrite_rule to a single custom post type url?

I have created a custom post type named bollywood, and a rewrite rule in order to map a URL such as example.com/bollywood/old-movies-of-hero1-with-hero2 to the query index.php?post_type=bollywood&...
1
vote
1answer
68 views

Adding rewrite rules directly to .htaccess file

I wanna add a simple rewrite rule RewriteRule ^apply\/? https://docs.google.com/forms/d/e/1FAIpQLSf5IrOhg0E_NAGZnOvMuaXhU80sio8bukaWVBkb87eEOa9kTw/viewform [L] my .htaccess file is like # BEGIN ...
1
vote
1answer
74 views

Bilingual WP site: How to achieve different URL sturcture rule based on its language?

A wordpress website with bilingual setup, with three languages: English ("primary language") : "en" Traditional Chinese : "zh-hant" Simplified Chinese : "zh-hans&...
0
votes
0answers
28 views

Duplicate content problems after adding an archive page to the article's post type

I have changed the url of my blog articles from www.mysite.com/article to www.mysite.com/blog/article, to achieve this, i have used two functions: if ( $post_type == "post" ) { $args['...
1
vote
3answers
139 views

How to add custom rewrite rules and point to specific templates

How can I add a custom rewrite rule so I can catch paths like these: /products/imports/filters /products/imports/elements /products/imports/parts And point them to a template file, for examples: ...
0
votes
0answers
38 views

How to remove inappropriate particles in the URL for a category WordPress?

When I send a request to WordPress of this type: wordpress.site.com/category-name/sfsfscf/post-name/ it generates the correct URL and returns wordpress.site.com/category-name/post-name/ (This is a ...
1
vote
1answer
50 views

Display content according to current URL

I want to create most of the website structure based on the external API Manufactures -> Brands Here is how the output of API look like array(2) { [0]=> object(stdClass)#448 (6) { ...
1
vote
0answers
10 views

Redirect my 2020 and 2019 posts [closed]

Do you know a method to redirect all links in one go from my 2020 and 2019 posts? My permalinks are like this: https://website.com/%postname%/ I have a quite a lot of posts and I don't feel like doing ...
0
votes
0answers
18 views

Rewrite custom post type URL in search

I have a website in which I have a custom post type (guest authors from CoAuthors Plus). With a plugin I managed to make post of custom type "guest author" searchable by WordPress legacy ...
3
votes
1answer
151 views

Custom taxonomies, with custom rewrites/slug, AND loading a taxonomy archive template from a plugin

I think maybe my understanding about rewrites and templates for custom taxonomies and CPTs is wrong and maybe someone here could help me solve my problem and educate me. So I have a post type, "...
1
vote
0answers
30 views

Share same Slug for a Custom Post Type and 2 Taxonomies

I'm trying to achieve an URL structure that implies sharing the same slug ("videos") for a Custom Post Type (video), and two Taxonomies (video_category, video_tag), in order to have: Page: /...

1
2 3 4 5
40