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
10 views

Custom rewrite rules not working with WPML

I have custom rewrite rules for posts on a WordPress website. The website is in french and I just added WPML to make it available also in english. WPML is configured to use directories (/en) for ...
0
votes
0answers
15 views

Changing the URL structure for hierarchy CPT's

I am using Toolset Post Type to create my custom post types. I need my slug to be something like this. example.com/parent-post-slug/child-post-type-slug For instance: I have a two post type, topic ...
0
votes
1answer
21 views

Order custom post type posts by custom field with pretty URL

I have a custom post type, let's call it my_post_type It has an archive at /my_post_type/ I'd like to create a pretty URL that behaves like the archive page, but orders these posts by a custom field ...
0
votes
0answers
7 views

How can I add a vanity URL for admin-ajax.php Calls?

Background I'm using the admin-ajax tool in WordPress to build a file generator. I have everything working, except that the current URL is ugly. I'd like to add a vanity URL that looks cleaner. My ...
0
votes
0answers
8 views

Trying to replicate archive\single url behaviour in a custom page

I created a custom page 'page-channels.php' since I get all the data from api requests I don't need or want to open a custom post type for channels but I would rather alter the behaviour of the page ...
0
votes
0answers
11 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
50 views

Using a template file for a specific custom URL

I was trying to use a custom URL to load a page template for single-events.php without rewriting the default URL format. I am using filter template_include to load the template like this: add_filter('...
0
votes
1answer
9 views

Remove part from dynamic url and redirect

How do can I redirect the following URL to the next URL? It essentially should remove the ID part (this is a post tag URL). http://wpsoup.test/tag/88/koffie/ -> http://wpsoup.test/tag/koffie/. I've ...
0
votes
0answers
17 views

Worpdress Elementor. How to read query variable from rewrote url in?

I need to create a Elementor page which should have the following URL structure: /order/(.*?)-([0-9]+)?$ At this page I should display a Elementor widget which will display information about order ...
0
votes
0answers
19 views

After adding add_rewrite_rule URL change automatically

I wrote the add_rewrite_rule to get some parameters in query string. the following rules are added in functions file. add_rewrite_rule( '^en(.*)/(.*)/(.*)/?$', 'index.php?post_type=client&...
0
votes
0answers
16 views

Rewrite dynamic URLs as pretty URLs in Wordpress functions.php (add_rewrite_rule) - what's wrong with my code?

I'm using an events calendar plugin to list events on my WordPress site. It uses a custom post type to give each event its own page. There are one-off events and recurring events (eg an event that ...
0
votes
0answers
23 views

The same rewrite slug for multiple taxonomies

I'm using the plugin custom post type ui and I have a custom post type with multiple taxonomies and I'm trying to get my URLs to work. Custom post type → works Taxonomy1 → works_cat Taxonomy2 → ...
0
votes
0answers
11 views

Multi-country+language, design controlled by one theme

I'm trying to cater to a site which would serve multiple countries, in multiple languages, while maintaining an easily updatable theme. Right now, I'm using WPMS (one site per country) with WPML (...
0
votes
0answers
16 views

How to rewrite search requests to the site URL so that they go to the home URL instead?

This site I'm working on has WordPress installed under the subdirectory /2020/, with the home page set to /. It uses a plugin for the menu system and the search bar, but the plugin sets the search bar ...
0
votes
1answer
21 views

How to get relative page for every post: /post-1/contact. /post-2/contact

Let's say I have a post type called jobs, and a page called contact with a form in it. Now I want the contact page to show on every job url ending with /contact. So job-1/contact, job2/contact etc. I ...
0
votes
1answer
17 views

I want to change url structure of my created archieve pages

i have created custom template in which i have run query from database . in the page i have run loop from database so i am taking id through url to another page and the link is creating like this ...
1
vote
0answers
16 views

Rewrite rules automatically for pages using specific template

I'm using rewrite rules to add an optional parameter to a page. This page uses a specific page template which handles the implementation of an external data source. add_rewrite_rule('^page/([0-9]+)/?'...
1
vote
0answers
16 views

How to use add_rewrite_rule in subdomain

I need to understand the concept of add_rewrite_rule() in wordpress in my case I have a subdomain based website by wild card I created a custom page called X.php This custom page function is to get ...
1
vote
0answers
18 views

Index page with the same id as the slug

I have wanted to ask this for a long time.. I have never worked out how to do this, is it possible? mywebsite.com/pots - This to be an index page showing posts or custom posts mywebsite....
0
votes
0answers
11 views

Website URL Permalinks

I used Prophoto 4 and recently upgraded my site to Profoto 7 and moved to a new Profoto template. My website URL is www.lorrainebhandariphoto-video.co.uk Now my site address URL and wordpress address ...
0
votes
0answers
22 views

Rewrite rules for custom taxonomies

I got car custom post type. And got custom taxonomies (model, year, color) for car post_type. Car archive link looks like this: https://example.com/car/ And i am filtering this archive page with $...
1
vote
0answers
18 views

Redirect based on a query string

I am working on project where the previous web developer has left the company. There is redirect happening based on the query string and I can't figure out where. The example URL is https://www....
1
vote
0answers
10 views

Create one page, land any other URLs starting with that page to the same place [duplicate]

I would like to create a Wordpress page, for example "Foods" Then I want every single one of the following URLs to land on the "Foods" page. There could be unlimited number of URLs that lead to the "...
1
vote
0answers
18 views

Change pagination url format

I have a URL like this: example.com/blog/page/5 I want to change it to: example.com/blog/page-5 I tried using a RewriteRule like this: RewriteRule ^blog/page-([0-9]+) /blog/page/$1 but this ...
1
vote
1answer
32 views

NextGEN Gallery Lightbox - Social Share URL Redirect

I am using NextGEN Gallery Pro - Lightbox's Social Share feature on my WordPress site which actually create and share a temporarily created url (first-url) on social media. Somehow the redirect doesn'...
0
votes
0answers
26 views

CPTs relationship

I have two CPT - project and publication. Is there a way to "connect" those CPSs to the permalink looks like: foo.com/project/lorem/publication/ -> archive-publication.php foo.com/project/lorem/...
1
vote
0answers
8 views

Custom Post Type - Category Rewrite - Remove Rewrite from Sitemap

I've got "case_studies" post type and categories for it as "case_studies_categories" with a rewrite to include category in URL. Everything works, but for some reason, rewrite url is in sitemap (as ...
0
votes
0answers
40 views

Two Custom Post Types in Permalink + Duplicate Slugs Issue

I'm having some trouble with WP adding those numbers onto the end of my slugs if it thinks it's a duplicate slug. The issue, though, is that it's not actually a fully duplicate URL, since I include a ...
0
votes
2answers
34 views

WordPress URL redirect and replace ? question mark

Following is example of what we are looking for. We're trying this in wordpress and we require all parameters as a variable Example 1 : http://example.com/tno/?parent=abc Need this : http://example....
1
vote
0answers
35 views

How to remove specific category from URL in Wordpress

My custom structure permalink is set as shown below and category base is set to . /%category%/%postname%/ My current URL structure is this: http://example.com/aaa/slug http://example.com/bbb/slug ...
1
vote
1answer
59 views

Can't change first part of URL rewrite for custom post type

I have successfully created a custom post type with a URL rewrite that changes URLs from: domain.com/post-type/slug To: domain.com/some-string/custom-field-value-1/custom-field-value-2/slug This ...
0
votes
1answer
32 views

Rewrite rule for custom permalink structure

I have a Custom permalink Structure setup Settings > Permalinks as: /%category%/%postname%.html But I want my url structure to replace /%category%/ by /%articles%/, so it looks like- mydomain.com/%...
0
votes
1answer
17 views

virtual page using url parameters to solve facebook sharing issues

Reaching out for help, as my head is spinning! In my site I have the ability to dynamically generate pages and I use URL parameters to indicate the database and record to use to retrieve the ...
0
votes
1answer
63 views

Pass parameter to custom post type single while keeping clean url

I'm working on passing a get parameter to a single custom post type in a clean url. So for instance there would be the custom post type 'services' which would have the single post 'gardening'. /...
0
votes
1answer
15 views

Show category name in the post URL only for specific categories

Is there a way to show the category name in the URL of a post which is in a specific category? I.e: I have a site which have a blog and two categories, blog and resources; right now this blog have ...
0
votes
0answers
18 views

Special Characters Url return to 404

I've managed to have permalinks with "@" (at sign) for my page with the help of @Andy's code on How to add dot(“.”) in post slug. But unfortunately, after creating post with @ on the url (example....
0
votes
0answers
18 views

How to change Wordpress dashboard login url to website URL?

I have a Wordpress website www.example.com Once a user goes to URL he sees Wordpress login page and below URL in the browser address bar. www.example.com/wp-admin/.... I want to change that ...
2
votes
0answers
30 views

Rewriting Woocommerce Product Filters To URL Segments

I'm working with a site where product category pages are filtered using query parameters: ?color=red&brand=nike&size=10 I'd like to use URL segments instead and rewrite the request to the ...
0
votes
1answer
25 views

add_feed rewrite overwriting standard permalinks

By doing a simple: add_feed( 'schedule', 'my_schedule_feed' ); I have created a feed at /feed/schedule/... easy. But when I go to /schedule/ (which is a page) it is now showing the feed! Looking ...
0
votes
0answers
21 views

Why is this rewrite rule not working (for a custom route)?

I am trying to setup a paypal return url of the form somesite.com/paypal-return In my child theme root I have file called paypal-return.php In my child theme functions.php I have /* * Set up a ...
0
votes
1answer
17 views

How can I re-query post_type and rewrite the url?

I have the url slush like the below. /category/land-residential-farm/?property_com_listing_type=sale I want to write the url to /category/land-residential-farm/property-for-sale then re-query the ...
0
votes
0answers
24 views

WP permalink working, but why content doesn't display

I'm running a wp-blog on LEMP stack, I'm setting permalink fro WP Admin panel to say example.local/blog/%postname% it shows full post name in the address bar, when I click any post, but it doesn't ...
0
votes
0answers
11 views

Build optional prefix for both post and pages, based on meta

I have posts and pages that have a metabox "new" which saves the meta new in the database for the post. What I am trying to achieve is to have an optional prefix /new/%slug% which shows the post if it ...
2
votes
1answer
173 views

Rewrite url for existing page without flush_rewrite_rules

I have created pages with slug test123 and test234 in wordpress, I want to create a plugin that doing the following when user request test123, and the content in test234 will be served instead. I ...
0
votes
0answers
19 views

Change url based on logged in user/different root?

I'm not sure how to word this question so I'm sure the answer is out there but I'm using the wrong search words. I have a URL where the end remains the same, but the beginning changes based on the ...
0
votes
1answer
124 views

add_rewrite_rule: Issue converting path to url

I would like my plugin to route /tradeIns for any domain it's installed on to the template file inside the plugin filder's templates/checkout.php. In my local dev site the desired url route would be ...
0
votes
0answers
21 views

Create category with special permalink

My usual permalinks are /%year%/title but for posts that in the category timeless, I want to remove the year. I have the following code, but the issue seems to be add_rewrite_rule is having no ...
0
votes
1answer
41 views

Custom Post Type Category URL

I've created a simple CPT named shop which contains some shop items. After that I've added category support to it which works fine ('taxonomies' => array( 'category' )). Then I created template-...
0
votes
0answers
17 views

woocommerce remove last sub category from product url

I am working on migration site. after migrating i am trying to make url look same as live site This is current url: https://photoland2.etrafficgroup.com.au/frames-and-albums/frames/wooden-frames/106-...
0
votes
0answers
38 views

Permalink Rewrite Rule Issue in CPT

For a custom post type blog in my site, I want to have the following permalink structure: mysite.com/blog/post-slug/post-id I am using the following code in my theme: function blog_links($...