Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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

0
votes
1answer
14 views

How to add rewrite rule to custom post type with parent in url with cpt ui?

I'm trying to create custom post types but i need the posts of custom post type to have the url along with parent category. Example for now i have custom post types science, tech, business. The url of ...
0
votes
0answers
13 views

Wordpress category URL ?cat=categoryName

I need to change my category structure like this: http://example.com?cat=categoryName but I have no idea how to do it. I have been searching for more than 3 hours but doesn't find any related ...
0
votes
1answer
27 views

copy attachments to another post type and change attachment url

On my site I have to custom post types and a function that let's users import photos from post type A to post type B, copying the meta values and it copy's the image to the folder specified for post ...
0
votes
1answer
13 views

Permalink misbehaving in Custom Post Types

I have a post type named careers which is, function do_careers() { register_post_type('Careers', array( 'labels' => array( 'name' => 'Careers', 'singular_name' => '...
1
vote
1answer
30 views

Custom post type as home page with custom url

I've changed the permalinks to add a string at the beginning of the url like this: /london/%postname%/ This works perfect for all the pages but not for my home page. I set my home page to be a single ...
0
votes
0answers
21 views

Set archive of custom post type like 'posts' page in reading settings is set

I'm starting development on a WordPress site soon. For a specific post type, they want the archive to be part of the page structure. For the default post type, you can set the archive to a static ...
1
vote
0answers
24 views

Alias 'wp-content' directory to something shorter (framework?)

I recall seeing this as a feature of a Wordpress Development Framework, so I know it's possible (can't remember the framework). I am interested in how to condense the Wordpress-generated urls to ...
0
votes
0answers
24 views

How to inject dynamic parameters into url pathinfo for all site content

Similar to this question here, but modified for my purposes: I want to inject into all urls of my website a country. For example: https://www.example.com/contact should be accessible by https://www....
0
votes
0answers
12 views

Routing for a post type archive with custom taxonomy as a url parameter

Essentially, I have a custom post type product and it uses a taxonomy product-categories. I currently have my routing configured to use the top level category as part of a product url, e.g products/...
0
votes
0answers
13 views

Remove child category from URL. I can not bring everything back

I deleted the child category using the hook: function wpse147453_remove_child_categories_from_permalinks( $category ) { while ( $category->parent ) { $category = get_term( $category-&...
0
votes
0answers
21 views

How create url rewrite for 3 different taxonomies in the same Custom Post Type

Hello I have a custom post type called "vehicles_cpt" to this are linked 3 taxonomias (year, make, model) I need to write a url like this https://localhost/2019/volvo/x7 redirect to the post that has ...
0
votes
1answer
26 views

How to change form action of wp-login page with a function

I'm manually creating my own Wordpress login form. The action parameter of all the forms points to wp-login.php. I want to change it for all of them to custom url (/login). Any idea how to that? For ...
0
votes
0answers
20 views

Removing CPT slug from URL results in 404 error for archive page

I have created a CPT with rewrite rules as follows: "rewrite" => array( "slug" => "/", "with_front" => false ), In the functions.php, I have added the following code: function ...
2
votes
1answer
35 views

Flush Rewrite Rules on init or rest_api_init?

if I'm using the REST API to create endpoints in my plugin, should I be flushing rewrite rules on init or in rest_api_init? I realize that it should be done on plugin activation/deactivation. However,...
1
vote
1answer
48 views

Taxonomy page returns 404 page not found

I have a custom post type and one custom taxonomy registered for it. The custom post type is called "memory-cards" and the taxonomy is "lesson".For this taxonomy I have create two terms "english" and ...
1
vote
1answer
45 views

Customize Custom Post Type URL

Actually I needs to change the structure of my urls for the custom post type ( I also want to customise taxonomy url but only targeting post for this question to avoid confusion) My custom post type ...
0
votes
0answers
18 views

rewrite slug with_front => false issue

Setup a custom permalink structure like this: /blog/%postname%/ It's working as expected with new registered post types set with a false 'with_front' but for some reason some post types also show up ...
0
votes
0answers
14 views

Register Taxonomy for Custom Post Type Tag page not working

I am using the 2017 theme with a custom post type Bookmark add_action( 'init', 'create_bookmarks_post_type' ); function create_bookmarks_post_type() { $labels = array( '...
0
votes
1answer
17 views

Show Mysql table elements as pages in Wordpress

I am trying to build a WordPress site, but I need a specific functionality and I haven't been able to find a plugin for it. I'm going to be scraping sites info and posting the info into a DB (this is ...
0
votes
1answer
10 views

Implementing geotargeting while using a single database

I'm working on a Wordpress site with a large amount of users in multple countries (UK, US, and sever African countries - Nigeria, Kenya etc). All our content is in English and we don't have the ...
0
votes
0answers
21 views

add_rewrite_rule returns 404 in parameter validation

Suppose I want to create a new rewrite rule like the following: add_action('init', 'fffl_router_add_rewrite_rules'); function fffl_router_add_rewrite_rules() { add_rewrite_rule('books/([^/]+)/?$',...
0
votes
1answer
22 views

Redirecting “wrong” but working links to their canonical URL in order to prevent search engine penalties (e.g. /123/ at the end of URLs)

The WordPress permalink system is really nice as it even detects minor problems with URLs and is loading the correct page. For example we have a page with an URL like this: http://www.example.com/...
0
votes
0answers
21 views

How to use a custom post type as child of a particular post of another CPT?

I have a custom post type services which uses a standard page instead of the usual archive ('has_archive' => false), so the content is user-editable. This has a url like /services/. One of the ...
0
votes
1answer
13 views

Wordpress address url option missing under general setting

Anyone can help me out ? Why don't I see 'wordpress address url' and 'site address url' under general setting in order to change url. like below image : Thanks in advance.
0
votes
0answers
12 views

Custom rewrites for tabs on a page

I have a Page Template, page-services.php, which displays content in various tabs. The page's URI is currently example.com/services. I want each tab to have its own permalink so that visiting a URI ...
1
vote
0answers
42 views

Rewriting “pretty” blog category URL with htaccess / add_rewrite_rule() causes 404 page

I'm migrating a site between hosts and am having issues with what should be(!) a fairly simple rewrite of a "pretty" URL to display posts filtered by category. domain.xyz/category/cat_name/ => ...
2
votes
0answers
21 views

Custom URL rewrite to specific page template

I have a standalone page with the slug: hubv2 that is using a custom page template which runs a small React app. The React app handles in browser routing and it works fine. For example I can hit /...
0
votes
0answers
27 views

Taxonomy Term Child Returning 404?

first post. I'm at a lose end with this and I just cannot get it to work at all. The general jist is that I've created a custom post type named 'Product'. I've also created a Taxonomy named 'Types' (...
0
votes
0answers
16 views

Custom URLs in Wordpress Search Results

what i want to achieve is to change default wordpress url on search result page. by default when someone search url is something like this http://www.domain.com/?s=nokia i want this url to be changed ...
0
votes
1answer
27 views

How to rewrite url for any specific taxonomy?

I have custom post registered it's archive has url example.com/doctors It's Single post has url example.com/doctors/john-cardiff It has categories as well, for example for cardiology category ...
0
votes
0answers
10 views

Adding rewrite rule for WooCommerce category?

How can a rewrite rule be applied to Woocommerce categories? I have a function to render the cart page on all URL's that end with /cart/. add_rewrite_rule( '^store/([^/]*)/cart/?', 'index.php?map=...
0
votes
1answer
11 views

catch urls with specific pattern and show specific content for them by plugin

I have written a shortcode in a plugin that shows some items. my shortcode: [showItems] now I put this shortcode in a page called items: http://mywordpress_site.com/items in this shortcode I only ...
1
vote
0answers
26 views

Plugin action rewrite rule - non_wp_rules

The wp rewrite rule I added to my plugin is not working. Here's my setup: Scenario I'm trying to get the site's ads.txt to pull from my plugin's ads.txt. eg site.com/ads.txt pulls from wp-content/...
0
votes
0answers
21 views

Why is there a 404 on page 2+ for my search page?

I've overridden the search.php template from within a plugin, and I've replaced the global $wp_query with a different one, and without any paging parameters it works fine. Once I add a /page/2/ on ...
0
votes
0answers
39 views

How to make “single post” permalink maintain it's sub-page structure

I have a custom post type called "Classes", and I have multiple sub-pages for my site for each different schools classes page (which loops through said custom post type) I.E http://www....
0
votes
1answer
38 views

Replace “http://localhost:8888/” by website URL in Wordpress

Due to some recent security breach, I had to replace my website on the server with all the new local files. Question: Now I see "http://localhost:8888/" string in my blog posts ( e.g. image sources ...
0
votes
0answers
9 views

SSL messes up rewrite for homepage, all others work fine

I installed a Let's Encrypt cert, then did a database S&R (with serializing/unserializing support) for http://mydomain to https://mydomain . The certificate works and I get a valid HTTPS ...
0
votes
0answers
12 views

Hosting wordpress on non 80 port always requires port in URL or I get too many redirects error

I have a wordpress docker container running on host: 192.168.1.1:32811 I set the siteurl and home to 192.168.1.1:32811 and everything works OK. I then setup an nginx reverse proxy on another ...
0
votes
0answers
23 views

Adding language string to all URLs

I'm trying to set up some simple localisation on a site but I can't seem to get Wordpress to prepend the path with a language. I've set up some JavaScript that detects the user's language and ...
0
votes
0answers
20 views

WordPress Rewrite Rule to EITHER Match 1 or 2 Taxonomies when adding to URL

I have a custom post type residential using a custom taxonomy residential_taxonomies and I am adding the taxonomy term(s) and the post type name to the url. It works fine if there are always a parent ...
0
votes
0answers
28 views

Rewrite post name / post title in the permalink

I have the following permalink structure: http://test.com/people/kids/joe-blogs/ I need to rewrite the post name (joe-bloggs) to a unique ID to protect the kids names - I have the following ...
0
votes
1answer
20 views

How to add rewrite rule for product compare page?

I'm trying to create a product compare feature where we can compare three products, Two products must be added while the third is optional. Trying to use the add_rewrite_rule to create a friendly URL ...
1
vote
0answers
112 views

Add parent/child taxonomy to custom post type url

I have seen several cases of one taxonomy being added to a custom post type url, but I have modified that function to include a parent and a child taxonomy term. However, I am getting a 404 when I go ...
2
votes
1answer
62 views

Rewrite WordPress Custom URL

I have a custom WordPress url which is generated by ID. I have to rewrite this url https://example.com/account/customer-bookings/?view-booking=4 to https://example.com/account/customer-bookings/view-...
1
vote
1answer
45 views

Add rewrite rule to call front-page.php?

I am trying to create a multilanguage website. And I have set my home page to a static page in my WP admin area. This home page ID is 2 and it calls front-page.php template when I am on the home page ...
0
votes
2answers
23 views

Two sets of url one content?

How can I configure to have two sets of URL that actually using the same content? For example: (set 1) samplesite.com samplesite.com/about/ samplesite.com/contact/ samplesite.com/projects/ (set 2) ...
0
votes
2answers
82 views

Custom Post Type canonical link / pagination redirecting to root

I have inherited an existing site and have recently been asked to make some changes. They have 'renamed' the default post as 'latest-news' using this 'my_new_default_post_type': <?php add_action(...
1
vote
1answer
25 views

Making a custom help center page

I am working now on a new WordPress theme and I want to make a help center system to allow users that will buy my theme do add helper articles. So my plan is: 1- Make a normal new page and create ...
0
votes
1answer
18 views

Fresh install redirects to www, breaking page loads

I set up a new Wordpress site, wanderandponder.com, on DigitalOcean yesterday. It was on a droplet that also ran several other Wordpress sites, without conflict. However, when accessing the domain, it ...
0
votes
0answers
16 views

Virutual generated url's, based on content CPT

I'm currently developing a website with different locations (addresses). I created a Custom Post type (locations), and the customer can add different options to this CPT like reviews, images, forms ...