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

Spurious URL structure (Adding extra /0/s)

We have just used a reputable external crawler to test our site and it is listing many (1,000s) of pages that have /0/ or /0/0/ or /0/0/0/ etc appended to the URL so https://example.com/news/news-post-...
0 votes
0 answers
14 views

Custom Post Type with multiple Custom Taxonomies / Hide Taxonomy Slug from URL

I have a Custom Post Type with 4 Custom Taxonomies. Everything is working great about this part. But, right now my taxonomies pages URL are: website.com/taxnomy/taxonomy-item I would like to have: ...
0 votes
0 answers
24 views

Add rewrite rule to make Woocommerce product category page seo friendly

I want to show sale products of that particular product category page by using /sale except using a query string stock_status=onsale. e.g https://www.example.com/sneaker/?stock_status=onsale It ...
0 votes
1 answer
17 views

Page not found: Custom search form with a custom search page

Let me show you an example of what I'm trying to achieve. On BBC website when you click the search BBC button on the navbar it brings you to a search page (https://www.bbc.co.uk/search). When you put ...
  • 101
0 votes
0 answers
30 views

Use a different URL path / permalink for CPT

I just need some advice. My permalink is currently set to Post name and everything is working fine. However, I will need to start using a custom structure for the default post type and change to /%...
0 votes
0 answers
20 views

Include specific category in URL automatically

My current WordPress permalink structure is domain.com/post-name with no category in the url. However, for one certain category (news), I'd like the category to be included in the url permalink ...
1 vote
0 answers
13 views

How to rewrite custom taxonomy term archive to use THE SAME SLUG/front as CPT

What I have: example.com/movies/{post} <!-- custom Post Type single post, e.g. /movies/batman --> example.com/genres/{term} <!-- custom Taxonomy single term e.g. /genres/action --> What ...
  • 11
0 votes
0 answers
28 views

How to transform multiple parameter URL to clean URL

I have a problem in my search function. when searching to the search field, I am fetching data from multiple get parameters in the URL. here is the url: domain.com/?s=&post_type=store&...
0 votes
1 answer
36 views

Wordpress is ignoring my post rewrite rule

I have the following code to change Posts to News, and add news-insights to the URL of every post: function cp_change_post_object() { $get_post_type = get_post_type_object('post'); $labels = $...
0 votes
0 answers
23 views

Custom child page permalink

I'm trying to customize the permalink of some child pages. I have this structure: example.com/story/story-name-slug/chapter-slug/page-slug And I'm trying to transforming that structure into this: ...
0 votes
1 answer
17 views

Add query args if website open in mobile

how do I add a custom query in the URL if my website open in mobile? for example, if open on desktop show: https://example.com I want in mobile URL like https://example.com/?mode=app I want to add &...
0 votes
1 answer
31 views

My bbPress rewrite rules aren't working [closed]

I'm using bbPress, and bbPress uses the rewrite so that: index.php?bbp_user={id} becomes /forums/users/{login} I want to change/add it so that it's: /forums/members/{id} The reason is that some users' ...
0 votes
0 answers
16 views

Can I change the URL structure for a CPT only?

As I mentioned in the Title, I need to set my CPT "Jobs" post URLs to something like the following structure. https://domain.com/jobs?jobid=123 Where "jobs" is CPT slug and "...
0 votes
1 answer
30 views

How can i ensure that SQL statements are not displayed if an enduser types the wrong variable name in the URL

My question is similar to this. It is about security of my wordpress site which has custom pages that call variables on the url. An example of my url looks like this: https://mysitevvv.ke/mysite1/...
0 votes
1 answer
26 views

Serving Images from subdomain in wordpress

This is my current image url https://example.com/wp-content/uploads/2022/06/sample.png served via cloudflare uploads folder is in my wordpress installation I am syncing the uploads folder to Backblaze ...
  • 1
0 votes
0 answers
16 views

Safest way to create a custom permalink

I'm building a plugin for woocommerce where a user can purchase tickets for participating in a quiz. BTW, the URL of the dev environment I'm building the plugin in is localhost/lottery (keep that info ...
  • 121
0 votes
0 answers
8 views

TranslatePress | secondary language category/sub-category not working correctly ```/%category%/%postname%/```

I'm using TranslatePress and using slug translate. now I'm having an issue with the single post URL, not redirecting correctly. my actual URL looks domain.com/fr/category/subcategory/postname ...
0 votes
1 answer
27 views

Get wordpress installation folder

I'm writing a rewrite rule, accompanied by two additional rewrite tags, which (the tags) must apply only on a specific page. In the past, when I had to do something similar, I had done it like this: ...
  • 121
0 votes
1 answer
20 views

Create page (not the post type) dynamically

I'm working on a custom plugin where the user/customer will be purchasing a ticket (it'll be a woo product) to take a quiz and win some prize... So suppose the URL of a product/quiz would be like ...
  • 121
0 votes
0 answers
11 views

Is it possible to create custom links inside a template?

I'm creating a template for a custom post type with the URL structure of TEMPLATE ONE mysite.com/firstname1-lastname1/ mysite.com/firstname2-lastname2/ ... etc I also have pages from a custom post ...
  • 1
0 votes
1 answer
24 views

Url Rewriting a dynamic wordpress page with parameters

I am struggling a bit with how to rewrite a WordPress URL. I have two custom post types that I gave these url structures: mysite.com/erika-mustermann/ mysite.com/offer/shoe-repair/?bername=Erika-...
  • 1
0 votes
0 answers
26 views

How to change an existing wordpress page rewrite rule?

I'm new here and I don't have mach coding experience. I've created a new page layout the data there is taken from a text file and the name of the file is passed in a parameter so for example the url ...
  • 1
0 votes
0 answers
49 views

Make the home page's slug visible in the browser's URL bar

Is it possible to show the WordPress home page slug visible in the URL bar? I mean when someone visits my WordPress website home page rather than displaying (considering that my website URL is website....
  • 1
0 votes
0 answers
18 views

Custom WooCommerce rewrite rules with comma delimiter

I'm trying to troubleshoot a wide-scale problem. I'd like to rewrite default WooCommerce permalinks for categories, to delimiter as commas. Let's take an example: Brand Model Generation Engine ...
  • 1
0 votes
0 answers
69 views

Dynamic URL Rewrite for Custom

I have a custom post type called Hotels which I woud like to link to using the below url structure: /{country}/{state}/{hotel-name} I am fetching and inserting posts dynamically, so I do not know the ...
0 votes
1 answer
15 views

Trying to add array of paths to post permalink

Am trying to add custom path to my article posttype so my article path will be www.example/parent-post-1/parent-post-2/the-actual-post i tried to add this code /** * @param $post_link * @param $id *...
0 votes
0 answers
17 views

How to define a rule in functions.php that ONLY disables the default wp functionality that undesirably changes '&' to '#038;'?

I use a quick redirects plugin and it's changing my URLs after the fact and thereby breaking some of my links. I never want wordpress to change & to #038;. There is an unwanted solution to turn ...
  • 130
0 votes
0 answers
12 views

returning the currect URL for nested posts

I have a posttype called (article) witch have a meta_key called (parents_ids). So the article can be related to multiple articles. I want to return the currect URL depending on the parent post For ...
0 votes
0 answers
21 views

Adding /blog in front of single posts (only)

I would like to add /blog in front of the url for a single post: e.g. website.com/blog/news-article -> single article website.com/blog -> blog archive (showing a list of all blogs etc.) Ive ...
0 votes
1 answer
66 views

How do I add a tag slug to a category URL to filter posts?

I want to add an option to my site to filter posts by one specific tag on the category page and at the same time have a nice URL (no query strings). So something like this: https://example.com/%...
0 votes
1 answer
19 views

Add static text to post URLs

I have 2 pages on my site which include blog posts (real site is pw protected): https://example.com/blog/ https://example.com/news/ All blog and news articles should have a URL that begins with https:/...
0 votes
1 answer
162 views

Setting Parent Page to Post

Does anyone know how to achieve different parent pages for posts? I've managed to code a Custom Post Type that sits under a specific parent page, but I want the option to change this from post to post....
  • 3
0 votes
0 answers
25 views

WordPress how to prevent URL encoding in URL of taxonomy terms

Is it possible to prevent WordPress from encoding URL with terms? I have a sample taxonomy term "iPhone5~iPhone7" and when I use it for the search function, it turns to "iphone5%ef%bd%...
0 votes
0 answers
21 views

How to rewrite URL back to default custom URL if no destination found

My current situation is: I'm redirecting the custom category request to below kind of url: http://my_url/news/category/abc I've managed to add my custom query var category and can get the query var ...
  • 1
0 votes
1 answer
72 views

How to pass username in affiliate link in wordpress website

I need to pass current logged in user in wordpress website as SUBID in the affiliate link as follows. Affiliate link format is like below. https://affiliatenetwork.com/track?id=myuserid&url=https:/...
0 votes
1 answer
35 views

How to set add_query_arg properly for home page?

I want to add lang query variable to existing URL. I have registered query variable: add_filter('query_vars', 'custom_add_query_vars'); function custom_add_query_vars($vars){ $vars[] = "lang&...
  • 578
0 votes
0 answers
26 views

Show index.php template instead of 404 page template

I have some posts that were permanently deleted, however, instead of wordpress returning the 404.php page template, it is returning the index.php template. In other posts, the behavior is right, but ...
0 votes
0 answers
25 views

Add rewrite rule for custom post type single page

I am new in the WordPress and I do not know how to convert query parameter as URL for custom post type single page. I do not want to change any affect result of single.php. Just want to convert below ...
0 votes
1 answer
42 views

Rewrite parameters as Url for SEO

I have urls of this form: example.com/event/?eventId=1 example.com/event/?eventId=2 The problem is Google is indexing only example.com/event, which is a blank page. It's not able to display an event ...
  • 11
0 votes
0 answers
14 views

Create Custom URL structure for specific Post category using Post ID instead of post name

My Custom Structure is set to "%postname%/" This works as expected, but for Posts with the Category "Latest News", I would like to change the URL structure to be "%postid%/&...
0 votes
0 answers
15 views

loading images, css and fonts from site url

I changed the site url to example.com/blog but the wordress url is blog.example.com, still css, images and fonts are loading from blog.example.com, is there any way to force wordpress to load files ...
  • 121
0 votes
0 answers
46 views

Custom taxonomy terms as children of multiple custom post types

I'm about to start a part of my project that I've been putting off for too long. I'm not looking for code, I'm looking for confirmation that I'm on the right track and any advice Stackexchange may ...
0 votes
0 answers
20 views

Remove cpt slug from url and use custom taxonomy instead breaks all other cpt

Im trying to do so, it works but also affects all other cpt (404 for all cpt but not resources one) this is what I have In the cpt definition ... 'rewrite' => array( '...
0 votes
0 answers
14 views

Home page url rewriting Wordpress

0 I want to do a URL rewrite in the WordPress home page I want to change my URL http://mysite.loc/?pays=senegal to look like http://mysite.loc/senegal. The problem is that I am on the WordPress home ...
  • 1
0 votes
0 answers
13 views

Weird urls after moving site from local env to a server

I've noticed after moving website to a server post slugs started looking something like 78a6a04c0d498postname78a6a04c0d498.
0 votes
0 answers
11 views

Changing the wordpress default search url to something like - ...example.com/search?query=keyword

So I was trying to customize the WordPress default search URL and I found several solutions describing how to add a custom slug to the WordPress search URL and turn them into something like ...example....
  • 101
1 vote
0 answers
28 views

Serve specific "template" page at any URL that ends in its slug

Still new to WordPress, so please go easy on me. Goal: Prevent users of a specific role from viewing other custom post types made by users of same role. Intended solution: Modify the URL and redirect ...
1 vote
0 answers
12 views

How to add a custom redirect rule for Post as subdomains?

I am trying to write a custom redirect rule to open a download matching pages. Example: postname.example.com/download Example2: postname.es.example.com/download I am using the following code in my ...
1 vote
2 answers
39 views

Append a query string to the end of every URL

I'm trying to append a query string to the end of every URL for logged in users for cache busting purposes. Here is the code I have but it doesn't seem to work. Any ideas? function add_admin_qs($url){ ...
  • 21
0 votes
0 answers
11 views

Add separate list of pages under Admin

I am working on a university website and as per their sitemap structure, I have to use pages>subpages only. But under some pages, there are hundreds of sub pages so it becomes complex to maintain ...

1
2 3 4 5
41