People who code: we want your input. Take the Survey

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
19 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
36 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: ...
1
vote
0answers
34 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
42 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
12 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
90 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
26 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: /...
0
votes
2answers
24 views

How to rename custom taxonomy URL with extra words

There are 2000 Custom Taxonomies, called tax_city in my website https://www.example.com/tax_city/london and I want to change URL to something like this: https://www.example.com/services/home-care/...
0
votes
0answers
32 views

Adding a 'blogs' prefix in the URL structure but only for blogs

In my site the blogs resolve as %category%/%postname% for now. However, I want the blog URLs to be /blogs/%postname%. I know I could go to Permalinks and add blogs as a prefix before %postname%. ...
0
votes
0answers
12 views

How to achieve permalink versatility

I am using a bit of custom code to list product categories in a permalink (Not ecommerce, just a product catalogue). The hierarchy is two product categories deep. function my_product_post_link( $...
0
votes
0answers
11 views

How to rewrite with “tag” at beginning of url, e.g. /kids/post-slug-here

I would like to be able to rewrite the following url's, prepending a profile "tag" to the path, so that I can switch styles and content based on that profile. Just like with a language tag /...
0
votes
1answer
33 views

Redirect htaccess [closed]

I need to help with redirect my page. For example I have websites https://example.com. I need to move content from https://example.com to https://example.com/blog. That is not problem and I do that ...
0
votes
0answers
7 views

Issue with permalink for CPT and Custom Taxonomy

I'm working on a website with a number of custom post types and custom taxonomies. I've setup a CPT named service with a custom taxonomy named servicecategory. The URL for my service posts look like ...
0
votes
0answers
42 views

Rewrite Search URL Permalink For CPT Custom Taxonomies

My site uses a CPT with custom taxonomies and shows this URL for searches : https://example.com/?s=&post_type=listing&location=bridgeport&sale_type=for-sale&property_type=office But ...
1
vote
0answers
8 views

Different URL rewrite rules loading the same page

I have a custom post type and building a URL based on parameters I'm passing through a query_vars filter, but both of these rules are loading the same page from my child theme: function custom_rewrite(...
0
votes
0answers
16 views

How can I rewrite the url in wordpress so that it shows the used categories instead of the custom post type?

I have created a custom post type called travel_reports. now the url of an example post is example.com/travel_reports/the_specific_travel_report but i need to have it in the way that it shows the ...
1
vote
0answers
41 views

Rewrite custom post type URL parameters

I would like to change the following parameterized URL: www.example.com/category/?keywords=&location=new-york&type=Wedding in this way: (invert city > category) www.example.com/category/...
1
vote
0answers
14 views

How to change category and year archive permalinks/rewrite rules?

first of ll I'd like to find a way to substitute 'category' with 'events' in permalinks. Currently I've got this: http://example.com/category/post-name/ And I would like it to be: http://example.com/...
0
votes
1answer
21 views

Append a parametter at first or last to a certain URL

I want to change a URL and want to add a parameter to the last or first of that URL. For example I have URL like below https://example.com/search/?cityId=49409&bedrooms=0&bathCount=0&...
0
votes
0answers
11 views

Pagination on taxonomy template not working after rewriting slugs

My pagination is not working on my taxonomy(sub-category) page. It keeps on loading my archive template. This happened after I applied function codes that re-write's url and producing all parent and ...
0
votes
0answers
11 views

File cannot get POST ID with rewrite rule enabled

I have this file that has always gotten the wordpress post_id correctly: <?php require('C:\xampp/htdocs/wp-blog-header.php'); require('C:\xampp/htdocs/wp-load.php'); ?> WP Post ID: <?php ...
0
votes
0answers
15 views

Custom Post Type with Custom Taxonomy and Permalink rewrite 404 issues

I am trying to set up a custom post type with a custom taxonomy applied with proper URL structure. What is working is website.local/demosite/products/technology/product-1/ this is showing correctly. ...
0
votes
0answers
12 views

I custom url form post wordpress

I have customized the post url link in wordpress, domain.com/post >> domain.com/cate/post but I want it to change the path to the new link. What do I do? function aly_post_redirects() { if ...
0
votes
0answers
16 views

How do I run a web app in my WordPress theme without the “wp-content/theme/…/webapp” in URL?

hope everyone's doing great. I have a web application that's pretty much a folder containing an index.html and some javascript stuff. I placed this folder in my theme folder. It works perfectly when ...
0
votes
0answers
28 views

Change permalinks structure for specific tag

I am looking for a code that can change the permalink of all my post who have a certain Tag. Regular permalink structure: /%category%/%day%-%monthnum%-%year%/%postname%/ The permalink structure I ...
0
votes
0answers
14 views

Wordpress Url post name comes first

I want to change my wordpress url from www.example.com/post to www.post/example.com post name comes before domain name.How we get that in Wordpress
0
votes
1answer
20 views

Wordpress Custom Post Type - Rewrite Query

So I have a project I am currently working on, where I have a Wordpress set to a permalink structure of /blog/%postname% for blog posts and pages are domain.com/page-slug/ I have created a custom post ...
0
votes
0answers
13 views

Category and subcategory in url Custom post types - 404

I added cpt and custom taxonomy. I writed function in my functions.php which adding in my url, category and subcategory then my url is "mysite.com/house/category/subcategory/post_name". Url ...
1
vote
1answer
25 views

Double domain name in category URL-s

My site runs on the latest version of WordPress. However, I have a problem with categories. Permalinks are set correctly and my category path looks like this: example.com/category-name. Links work ...
0
votes
0answers
20 views

Doing add_rewrite_rule only for specific post type

so I have these two rules for projects CPT. function addMyRules(){ // variables add_rewrite_tag('%eventid%','([^&]+)'); add_rewrite_tag('%version%','([^&]+)'); // release-...
0
votes
0answers
21 views

Add user name in the URL like sub-folder

I want to add a username or any other dynamic string after the site URL like http://example.com/username-a/page-url http://example.com/username-b/page-url or it may be any string in the URL like ...
0
votes
0answers
16 views

Rewrite rule with query strings

This thread works as expected. I have a question if it's possible to remove mypage. The following also works, but now every page is going to mypage. add_rewrite_rule( '^([^/]+)/?', '...
0
votes
0answers
29 views

Custom Post Type & Taxonomies - Rewrite

I use Custom Post Type UI plugin to create new post types and taxonomies. I created post type cpt_recipes "has_archive" => "recipes", "rewrite" => [ "slug"...
0
votes
1answer
122 views

Divi change project category slug

How to change taxonomy urls in wordpress? Following along with this question and this one But can not get the desired outcome. The default is: example.com/project_category/%category%/ What I want is: ...
1
vote
0answers
17 views

Front custom edit post page for each post

I have made a custom post type named ticket and I want to make an edit page for every single ticket like StackOverflow if the question is like this: wordpress.stackexchange.com/questions/109592/how-...
1
vote
0answers
16 views

Adding custom post category slug in permalink causes 404 error for pages and posts

I have added a custom post type, I want to add the custom post category in its permalink instead of the static base. For example for the custom posts I want the following permalink structure: mysite....
0
votes
0answers
18 views

CPT UI taxonomy URL slug

So, i have cpt "provider" and 2 taxonomies - "location and "service". When i create post "electrician in nyc" and tag it under "NYC" as locations and "...
0
votes
0answers
15 views

Add suffix to post urls and read its value?

i have some hard time using wordpress rewrite API, what we want is to create gallery and take info from the post to populate, however the requierment is that permalinks be structured like this: site....
1
vote
0answers
26 views

add_rewrite_rule is redirecting instead of rewriting url

I have a page that is accessible at /products/. I want to be able to access it at /products/canada/ontario/toronto/ (and not redirect to /products) The place names after /products/ should be query ...
1
vote
1answer
17 views

Access files at new location using old file paths

I have a bunch of posts that contain images with urls that follow this pattern: https://example.com/example_directory/files/2019/04/file.png I've imported the posts into a new install of wordpress on ...
0
votes
1answer
17 views

Best way to trigger rewrite rules

I typically call the rewrite rules with this action add_action('init', 'add_my_rewrite_rules') But what I do not like about it is that the rewrite rules are written every time an init action is ...
1
vote
1answer
67 views

How to remove wordpress directory slash

I have installed a website in my domain directory like example.com/website. The main issue or problem is that it redirects me to example.com/website/. I never want redirection and I just want that my ...
0
votes
0answers
9 views

Exclude “Blog” Page From .HTML Extension Addition in wp_rewrite

I currently have all the permalinks for pages/posts on my site on my site rewritten to add .HTML to the structure. However, in an effort to avoid 301 redirects I would like to exclude the blog page ...
0
votes
1answer
42 views

How to redirect Webp files?

I was using all images as webp files for performance, however I've stopped using and deleted them (only .webp files) all from FTP. Now having problems with 404 errors. I would like to redirect all ....
0
votes
0answers
14 views

Add folder to URL path

I have a couple of pages I would like to put in a subfolder and have it appear in the URL without affecting the URL structure for other pages. Example: https://www.example.com/subfolder/abc https://...
0
votes
0answers
14 views

Multiple permalinks for a single custom post with post ID in permalink and post title

I'd like to be able to have multiple permalinks for the same underlying post (so if the post title is modified, the people still will find the page) - So, One URL will work with 3 different options. ...
0
votes
0answers
12 views

Wordpress dynamic page handle in theme

I am creating a wordpress theme My index.php is working great I would like only 3 urls on my website / which is going to wp-content/themes/my-theme/index.php or an ther fine I do not have problem ...
0
votes
0answers
14 views

custom url for each menu

I have designed a plugin that has a page for user account with custom templates and graphics. Inside this page there are menus that each have a separate content. just like a WooCommerce my-account ...
0
votes
1answer
31 views

Add custom path to url to specific pages

Right now all pages path like /faq/ or /about/. I need path like /home/faq/ /home/about. I tried change url slug in edit page. But Wordpress change my home/faq to home-faq. I installed plugin Create ...

1
2 3 4 5
39