Questions tagged [permalinks]

A permanent link to an item (a blog post, an attachment, ...). The default structure is "?p=123", but WordPress can handle "pretty permalinks" and will rewrite them internally to the former version. If you have a question about special rewrite structures you should use the [url-rewriting] tag.

0
votes
1answer
19 views

Custom Taxonomy rewrite rule causes 404 error on page or single post depending on if it's set to “True” or “False”

I've been googling, tinkering around and investigating/testing settings however nothing seems to work so please bear with me on this and please help me if you can. Thanks so much! I have the custom ...
0
votes
0answers
8 views

How to fix wordpress permalinks flip in hebrew

I have a WordPress website in hebrew. My problem is when have a parent page and a child page, the child page url permalink is backward(the child page slug is after the parent page slug). I want first ...
0
votes
0answers
13 views

Custom permalink structure causes 404 error on standard wp pages

I have the custom taxonomy called "location" created via the CPT UI plugin and "Custom Structure" of example.com/%location%/%postname%/ in Settings >> Permalinks. I also have below translate rules so ...
0
votes
0answers
7 views

Custom Post Permalink Change Including Parent Post

I am working on a plugin for custom posts. I need to remove the custom post slug. I used this code. function remove_cpt_slug( $post_link, $post ) { if ( 'cars' === $post->post_type &&...
0
votes
0answers
8 views

Create one temporary permalink in wordpress for form

I have started a freight company and am using sub contracted drivers I am trying to add a Proof of delivery solution to the website. Ideally, I would like to create a temporary permalink which I can ...
0
votes
1answer
28 views

Change permalink structure

I changed the permalink structure from /%category%/%postname%/ to /%category%/%post_id%/ What url should I put in the .htaccess file? Thanks
0
votes
0answers
32 views

How to create a standard WP Page that has the same url as an archive

I've tried to Google this but to no avail. I'm a newbie at programming but I can say I'm adept at configuring WP - pretty please, please bear with me. :) I have a CUSTOM_TAXONOMY that when viewed, ...
0
votes
1answer
22 views

URL issue after setting up Custom Structure in Settings >> Permalinks

I've tried to Google this but to no avail. I'm a newbie at programming but I can say I'm adept at configuring WP - pretty please, please bear with me. :) I have a CUSTOM_TAXONOMY that when viewed, ...
1
vote
0answers
12 views

Wordpress every page is 404 not found including admin resources

Haven't changed anything on my wordpress in about a year. Suddenly every page is 404 not found, including the admin dashboard. Any help much appreciated.
0
votes
0answers
11 views

Page not found on page. How to write a rewrite rule for a custom post type?

add_action('init', 'my_custom_init'); function my_custom_init() { register_taxonomy('manufacturer', ['product'], [ 'labels' => [ 'name' => 'Manufacturer', '...
0
votes
0answers
14 views

Wordpress generates weird permalinks

I have a problem with weird permalinks generated by wordpress https://example.com/page/19/ https://example.com/page/19/?cat=-1 https://example.com/?cat=-1 How I can fix it and disable generating ...
0
votes
0answers
25 views

how can I use SQL query to find duplicate posts using duplicate meta value instead of post title

I am using wordpress to syndicate RSS feeds and I get a lot of duplicates, however most duplicate plugins only check for duplicated post title. This is no good as posts often have the same title but ...
1
vote
0answers
19 views

Create a PHP page to refresh the permalink on a custom table

I need to access the permalink of every post, I can achieve this task by creating a template page as shown here but it looks like a dirty solution for me. How can I write a slim PHP which start the ...
0
votes
1answer
14 views

Custom function making troubles in get_permalink for ACF relationship fields

I'm using a custom function to add .html to my custom posts & pages, working with WPML. This script is creating a bug on ACF relationship field permalink. My custom function : function ...
0
votes
0answers
22 views

URL rewrite_rule for GET parameters - Not Working

I want to add custom rewrite rules for my url having GET parameters on homepage e.g http://example.com/?jobs=1 should be http://example.com/jobs/1. Note: Get params can be string as well Well I have ...
0
votes
0answers
34 views

Display post date with the date archive link for custom post types

i have a custom post type and every single post it displays post date like 05 Jun 2019. i show this date with this code : <a href="<?php echo get_day_link(get_post_time('Y'), get_post_time('m'),...
0
votes
1answer
18 views

Get page by path - honoring permalink settings (urls w/slashes)

Let's say I have a page with the name sample-page. I can do this: get_page_by_path('sample-page') To get that page. Now, let's say I want to get a post where the URL to that post is /post/8. If I ...
-1
votes
0answers
24 views

How I can get custom post link by two custom taxonomies IDs

I have in loop list of taxonomies IDs and one ID of second taxonomy example: <?php if( have_rows('taste_category_settings') ): ?> <ul class="product-wrap__category--...
0
votes
0answers
20 views

Redirect page to homepage, keeping URL

I'm creating a site where every page is really rendered on a single page - the homepage. I'd like to make it so page URLs - like /about-us/ - redirect back to the homepage, but keep the same URL (/). ...
0
votes
2answers
34 views

Unique one time use URL

I’ve been searching for solution to my problem but posts already made are not fulfilling the answer to me, or I'm just not qualified enough to work this out. Here is what I need: I’ve got a simple ...
0
votes
2answers
26 views

How can I get the list of all pages URLs including their shortlink IDs?

I would like to get the list of all URLs from a wordpress installation. Nevertheless, I Don't want the full post titles in the permalink but I would like the shortlinks instead. I would like to get ...
0
votes
1answer
17 views

WP adding noopener and noreferrer to all links

I'm using Classic Editor (not Gutenberg) and WP is adding rel="noopener noreferrer" to ALL the links, whether it is target="" or target="_blank" or target="_self"! I want to remove noreferrer from my ...
0
votes
1answer
13 views

Make last three words of excerpt a link

I'd like to have the last three words in an excerpt to be the link to the permalink instead of having a read more button. How would I do that?
0
votes
0answers
29 views

Remove WordPress custom postype base slug and prefix permalink with custom taxonomy + post title or just post title

What I want to achieve seems pretty trivial still the solution is yet to be found: I want to be able to avoid having the slug of the custom postype, (ie. article) and have in the permalink the ...
0
votes
1answer
34 views

How to rewrite product permalinks in Woocommerce to use category slugs

I know here is an information about the issue, but I didn't find full working solution. I need to use product category slugs in my product permalinks so the links are to be like example.com/laptops/...
0
votes
1answer
35 views

Redirect Changed Permalink on wordpress

Please I recently changed my site permalink structure, from https://example.com/postname/ to https://example.com/category/postname/ I have searched online and even here but all I am seeing is /...
0
votes
0answers
28 views

Enabling hierarchical in a Custom Post Type gives error 404

For a project I have a custom post type called Place. This custom post type can have a page as a parent, and that page can have other parent and so on. Place is always at the end of the sequence. At ...
-1
votes
1answer
14 views

Support Gallery link to pages

Hi i am new in wordpress i am try to show small gallery (like services) on home page and i want them to link them with pages not with post. currently i am working on theme. it has a services option ...
0
votes
1answer
25 views

Permalink conflict with React Router in subfolder

I have a Wordpress install on the root of my apache server. I've built a photo gallery in React which is in the subdirectory /gallery. The gallery home page load properly. If I try to go to any other ...
0
votes
1answer
19 views

Internal forward link with add_rewrite_rule

I want to forward a link to another link but internally. I've set up the wordpress to show post links like this - https://asif.bzstage.com/medical/website/nyc/ which only throws 404 error. However If ...
0
votes
2answers
24 views

How to have a dynamic slug and rendering the archive-{post_type}.php?

So I have a Custom Post Type named network and Custom Taxonomy name company_category. Everything is all good until I can't render http://localhost/digitalhxstaging/company. Both Company Category and ...
1
vote
1answer
27 views

How to remove the sub-category from Woocommerce product URL

In permalinks settings the 'Shop Base with Category' /shop/%product_cat%/ permalink setting puts all the hierarchical categories in the url, for example: http:// mystore.com/shop/parent-category/...
0
votes
1answer
19 views

How to 301 redirect from url with post id to permalink with post name (slug)?

my posts have urls of two different types: one with post id and other with post slug: /post/789 /post/my-post-slug i'm doing this using: add_rewrite_rule( 'post/(\d+)/?', 'index.php?p=$...
0
votes
0answers
12 views

Single post showing 404 not found page (permalink problem)

Using WordPress' default post type, I'd like everything to be filed under /blog/. For example: /blog/[parent category]/[child category]/[post permalink]/ Here's an example post: Parent category: ...
0
votes
1answer
35 views

Custom post type single with custom URL structure

I have a function that rewrites the URL before post slug including a custom taxonomy function wpa_show_permalinks( $post_link, $post ){ if ( is_object( $post ) && $post->post_type == '...
0
votes
3answers
59 views

Get the current post/page URL with plain permalinks

I got it to work with this: $url = home_url( add_query_arg( array(), $wp->request ) ); However, if the permalink is plain, all I'm getting is the homepage url (instead of the post url). So what'...
0
votes
1answer
28 views

Add slug to default post permalinks ONLY

I've been browsing and reading and testing and can't seem to find a clean solution for my problem. A solution that doesn't affect all other post types, categories, custom taxonomies, etc. :( Is there ...
0
votes
1answer
16 views

Adding query string to multiple page urls in a Wordpress function

I have a wordpress function that adds a query string 'nocfcache=1' to a single page url. function nocfcache_query_string( $url, $id ) { if( 42 == $id ) { $url = add_query_arg( 'nocfcache',...
0
votes
0answers
15 views

Is there a way to setup permalinks structure for Taxonomy term and custom post single without conflict?

This is the desired output: a.) for taxonomy term = /post-type-slug/taxonomy-term-slug/ b.) for post single = /post-type-slug/taxonomy-term-slug/post-name/ The problem is only one of these setup ...
0
votes
0answers
28 views

Add a url parameter to the current post and read it in a shortcode

I am trying to add a parameter to the currently visited url but it doesn't work. I've tried query_vars, pre_get_posts, post, post_link, page_link,post_type_link.... None of this work... How can I ...
0
votes
1answer
37 views

permalink not showing correctly using wp_insert_post and post_name

So I am using wp_insert_post() to create new posts dynamically. But I am trying to achieve the permalink structure to Parent/Child page as: Parent/Child/GChild or mydomain/MYTitle/1/1/ (yes I want ...
0
votes
0answers
22 views

301 redirects after changing permalinks

I've recently changed my permalink structure from /%category%/%post_id%/ to /%category%/%postname%/. I've also switched from Yoast to The SEO Framework plugin. Prior to making that switch, I deleted ...
1
vote
0answers
60 views

Page preview is shown, updating page gives 404 error

I can add new pages and preview them, but once I upload them I get a 404 "Not found" error. I thought it's a problem with my permalinks, so I followed some tutorials to fix this like http://www....
0
votes
2answers
124 views

404 on pretty permalinks when serving via HTTPS

I deployed my wordpress site in Google Cloud Compute Engine. To enable SSL I followed the the steps outlined here https://www.onepagezen.com/free-ssl-certificate-wordpress-google-cloud-click-to-deploy ...
0
votes
1answer
36 views

404 error on published page with specific permalink

I am experiencing a strange error with my Wordpress install. I've got a dozen of pages, %postname% permalink structure, everything works fine. For one of the published pages, I reverted it to draft ...
0
votes
1answer
50 views

Plugin not working & permalink erorr after upgrade to php 7x on Nginx

This plugin code was working fine on apache server with php5 but now i am installing on nginx with php7 & wordpress 5.x, its having permalink error (showing 404 error). It's working with wordpress ...
0
votes
1answer
20 views

Two URLs of one post is available

I have WordPress blog with permalink /%category%/%postname% it is OK when i have one category. but when I add another, the post is available with two URL and i think its bad for seo for Example: ...
3
votes
1answer
54 views

Custom post type permalink changing itself every other change

I have created a parent > child > grandchild structure. (Courses > Series > Episodes). I have created the below code which updates the urls for each of the custom post types so that I can have the ...
1
vote
0answers
27 views

Wordpress returning 404 for multisite pages

I'm trying to configure a WP Multisite to run locally, all is fine on the server, but getting this to run locally is turning into quite a pain. The issue I'm currently seeing is that some of the sites ...
1
vote
0answers
22 views

Wordpress custom post type permalink rewrite shows page not found

I need to have 3 custom post types in my wordpress site, each one being a parent of another. Courses > Series > Episodes I have fully created a functions file that registers the custom post types ...