Questions tagged [wp-redirect]

Redirects the user to a specified absolute URI.

Filter by
Sorted by
Tagged with
0 votes
0 answers
10 views

Woocommerce permalink URL change in DB

I am changinf URL structure and product URL on the wwebsite. Problem is this: When I change permalink structure on the WordPress admin, it creates directly new URL with new structure for each product. ...
Aleksandre Khachaturov's user avatar
0 votes
1 answer
20 views

wp_redirect problem using code snippets

i'm losing my mind a little bit with this one. I'm new here so please tell me if there's anything else I can provide to help explain myself. I want to restrict certain pages based on user IP, but the ...
Firemax's user avatar
0 votes
0 answers
23 views

Cannot find redirect - Wordpress behind HTTPS proxy (Cloudfront)

I have a Wordpress installation sitting behind Cloudfront. SSL termination is done on Cloudfront, with the web server listening on Port 80 only. The following additions have been made to wp-config.php ...
jdog's user avatar
  • 101
3 votes
1 answer
79 views

Redirect posts to post editor page based on query string

I want the posts that has the param edit to open the respective post editor page. This is because the admin bar is disabled on my site. So I need to make things easier to edit on my sites. I made the ...
Emmanuel Borges's user avatar
3 votes
1 answer
287 views

wp_redirect() doesn't work

I am inserting a piece of code to my website that includes a redirect statement. Everything works fine except the wp_redirect();. The following warning message appears. Cannot modify header ...
Asmat Ali's user avatar
  • 129
0 votes
0 answers
227 views

Does wp_safe_redirect() no longer works?

Inside index.php I used wp_safe_redirect to redirect users to the main global page if users write a false url. I have 1 domain and three subdomains. These subdomains refer to php files and not to ...
imagIne's user avatar
  • 11
0 votes
2 answers
71 views

subpages are redirecting to the homepage

A few days after installing 6.1.1 some pages started redirecting to the homepage. I renamed .htaccess, disabled all plugins, and am using the 2022 default theme to try to locate the source of the 301 ...
Alex T.'s user avatar
  • 51
0 votes
1 answer
36 views

Post Migration Site Migration Redirects All Known Solutions Attempted

I am running wp 6.1.1 wp 2023 theme with php8.1-fpm & apache2. I am migrating a site from webinar.example.test to staging.webinar.example.org I use git to push files and rsync/wp-cli to upload db ...
mjones's user avatar
  • 153
0 votes
0 answers
36 views

Frontend redirect after delete post in wordpress

I'm using the following link to delete a post in the frontend of wordpress: function wp_delete_post_link($link = 'Delete', $before = '', $after = '') { global $post; if ( $post->post_type == 'page' ...
Tyler's user avatar
  • 1
1 vote
0 answers
54 views

Create a 301 Redirect automatically when adding %category% in the permalink

I was wondering what would be the best approach to set 301 redirects. I have around a thousand blog posts and 19 categories so individually setting them up is a challenge. Though setting up 19 ...
xaykogeki's user avatar
0 votes
1 answer
54 views

Redirecting the user to the admin table area after publishing a post, getting an invalid response error?

I'm trying to redirect the user back to the custom post type page in the admin area after they publish a post but i'm always getting the error: Publishing failed. The response is not a valid JSON ...
Duts's user avatar
  • 1
0 votes
1 answer
59 views

Other pages fine but wp-admin showing ERR_TOO_MANY_REDIRECTS Error

wp-admin showing ERR_TOO_MANY_REDIRECTS Error and can't let me login into dashboard but Other pages loading fine. FIXED
rawaha johns's user avatar
0 votes
0 answers
19 views

Redirect drafted post of custom post type to URL?

I have a site with a custom post type for "Personnel". When a Personnel post is drafted, I'd like to redirect the user to a custom notification page rather than a 404. I have tried the ...
nickpish's user avatar
  • 217
1 vote
1 answer
32 views

External rewrite rules missing in htaccess - Multisite

I'm trying to set up some external redirects, but it seems like they are not being added to htacccess even tho it's supposed to (I think). add_rewrite_rule('^dashboard\/([^.]+\.(jpe?g|gif|bmp|png))$', ...
Zeldri's user avatar
  • 11
0 votes
0 answers
25 views

How do you maintain a debug session after wp_redirect()?

I've been having a hard time debugging the admin "Search Products" functionality for a Woocommerce-enabled site. The problem is that when execution encounters the call to wp_redirect() it ...
KalenGi's user avatar
  • 655
0 votes
0 answers
33 views

Redirect DRAFT Posts to a Custom URL (Custom Field) : Currently 404 Page

I am trying to create a function that REDIRECTs Draft and Trashed Posts to a custom field I have in all of my posts. I am calling this function at the start of header.php, however the webpage just ...
Adam Beaumont's user avatar
0 votes
1 answer
76 views

send popup after wp_redirect()

Hello Wordpress Developer, I want to ask about how to send popup after wp_redirect(); I'm sending link to user for verify. I just want to let user know that the verify process is done. Here is the ...
Hendra's user avatar
  • 5
0 votes
0 answers
73 views

Infinite redirect loop in my local environment

I downloaded the production site (which works fine) locally. Haven't changed anything except the database credentials and the siteurl, home options in the wp_options table to my local url. The site ...
user21861's user avatar
0 votes
0 answers
27 views

Redirect Page ID, based on logged-in User Role

I am trying to accomplish the following in WordPress via the functions.php file. If user is "This Role" & If "Page ID#" is being visited then "Redirect" to this &...
MRedzovic's user avatar
0 votes
1 answer
28 views

Check If Taxonomy A and Taxonomy B has same Slug, 301 Auto Redirect Tax A to Tax B if True in Wordpress

Please How do I achieve this? I have WordPress Default Taxonomy - Tag and a custom Taxonomy - Artist. I want to check for TAGS that have the same slug as ARTIST and 301 redirect it to the ARTIST. ...
Joe Titus's user avatar
0 votes
1 answer
458 views

wp_redirect is not working sometimes

I've tested the following code in my function.php: if ( $_GET['test'] ) { wp_redirect('https://google.com'); } and it works, if I go to https://example.com/?test=true, I will be redirected to ...
shenkwen's user avatar
  • 131
0 votes
1 answer
346 views

Redirect after scrolling the page

is it possible to create a redirect only after the page has been scrooled, for example, in the middle and redirects to another page? I tried various solutions and plugins but couldn't find anything ...
Meliodas861's user avatar
1 vote
0 answers
37 views

Adding rewrite rule dynamically for search results redirecting to 404 URL

We need the search url structure like the below URL : https://siteurl.com/in/chennai/accountant/ We have already a post url with same structure for single post detail page URL : https://siteurl.com/in/...
RagEsh's user avatar
  • 11
0 votes
1 answer
26 views

How $_GET['updated'] variable is passed when updating a user?

I have added two user metas and they are functioning perfectly. Now I want to show a warning message according to the input. I have passed the status through a get variable(named meta_warning through ...
sariDon's user avatar
  • 255
0 votes
1 answer
502 views

Staging redirecting to live site (under construction page)

I created a staging environment from my customers live wordpress website. now when I try to access it without being logged in as an admin, it redirects to the live "under construction" live ...
PatTheBeast's user avatar
0 votes
0 answers
65 views

Bulk redirect all post

I change my url old = /category/post-title/ new = /tips/category/post-title/ I add tips after site url for all my posts. how I bulk redirect without list one by one?
Baim Quraisy's user avatar
0 votes
1 answer
38 views

WordPress multi domain: page redirect to main domain whenever WordPress do the URL guessing issue

I have 3 different domains for a single WordPress project (for example, www.aaa.com, www.bbb.com, www.ccc.com). www.aaa.com is the main domain. The problem is, whenever I access the page that ...
Muhaafidz Md Saufi's user avatar
1 vote
1 answer
434 views

Why "exit" is needed after wp_redirect?

This is probably a PHP question, but since I encountered in on a wordpress documentation page, maybe I will get better answers here. On https://developer.wordpress.org/reference/functions/wp_redirect/ ...
shenkwen's user avatar
  • 131
0 votes
2 answers
466 views

Wordpress wp_redirect() not working after get_header();

I would like to ask about the wp_redirect(); function. Before I ask this question, everything was working on both local and test servers. But right now, for some unknown reason, on my local ...
Mr. Kenneth's user avatar
1 vote
2 answers
937 views

How can I prevent caching of wp_redirect?

I am working on a multisite install where one specific site needs to have access restricted to only users who are logged in AND have a specific user meta set (key="cr_access", val="Yes&...
Ben Aldrich's user avatar
1 vote
0 answers
74 views

Why is the session clearing after wp_safe_redirect?

I've been pulling my hair out with this for months now, and it's causing many issues in several places. Can anyone tell me why after setting a $_SESSION variable, and then performing a ...
Lee's user avatar
  • 317
0 votes
0 answers
240 views

Debugging issue with redirection in Wordpress

So I made a post, and on the admin panel when I edit, I am told I can preview the post with: https://www.evil.com/promotions/halloween-mega-sale However, it redirects to: https://www.evil.com/promos ...
Sayaman's user avatar
  • 135
0 votes
1 answer
142 views

Custom Login page, redirection and restrictions

I'm having some issues with my custom login page with redirections and restrictions. Any user can browse a 'community' page but they can't access the 'distributors' pages. I have set a rule so if ...
Maluco's user avatar
  • 1
1 vote
1 answer
95 views

Wordpress category page redirects in .htaccess not working

Wordpress automatically generates category pages, for example: https://planthardware.com/category/microgreens/recommended-equipment/ I want to redirect this to a custom page, for example: https://...
Turillian's user avatar
0 votes
2 answers
121 views

Redirect Users who aren't logged in, aren't post authors and aren't admin. Frontend

Very new to PHP and I'm trying to do the following through a snippets plugin but keep getting critical errors: Restrict all non-logged in users to home, about and pricing pages. If attempting to ...
Jake Billington's user avatar
0 votes
1 answer
232 views

random post redirect in wordpress with a .php file

I saw a website let say example.com. Now there is a file called go.php. Whenever we go to example.com/go.php, we are redirected to a random post on that site. This happens everytime. That site is ...
Aman Rawat's user avatar
0 votes
1 answer
156 views

Redirecting non-logged in users trying to view Group pages but not the Group directory

We are looking to redirect all Groups pages (but not the Groups directory page /groups/) in BuddyPress for non-logged in users to the /register/ page. We are currently using this snippet for member ...
Nifty's user avatar
  • 3
1 vote
1 answer
591 views

How do I redirect the browser to 404 page, if no posts are found in home page

I am listing posts on the homepage with pagination and if no posts are found on the home page. I want to redirect the page to 404 page and get 404 response code. For example, example.com/page/200 Page ...
MT09's user avatar
  • 13
0 votes
0 answers
332 views

Fatal error: Uncaught Error: Call to undefined function add_action()

I'm working with WP Engine and added their geotarget add on and my redirect is working when I use my VPN in anywhere outside the U.S. which is what I want. However, when I test within the U.S. I get......
Epson_Mil's user avatar
0 votes
1 answer
161 views

Edit Post with a parameter in URL

UPDATE It seems that get_edit_post_link() is trying to get the Edit url with ?editor, that doesn't exist but if we set manually the url, it will work: <?php add_action('init', 'edit_post_please'); ...
Locke's user avatar
  • 185
0 votes
1 answer
39 views

Redirect WordPress login for customers but not admin

I know how to redirect people from the /wp-login.php, however, I'm having an issue with excluding people who come from /wp-admin/ (which redirects to wp-login.php. Is there a way to exclude these? ...
Philip Deatherage's user avatar
0 votes
1 answer
201 views

remove SLASH on single_post but KEEP on categories and parent pages

My current permalink structure is  /%category%/%postname%/  which produce urls as: (category_base removed using "FV Top Level Categories" Plugin) category: example.com/class-10/science/ ◀▬...
Nitin Kumar's user avatar
0 votes
0 answers
30 views

WordPress site login Redirect

I try to log in to my WordPress website, It logs in but when I try to click anywhere in the dashboard, it redirects me to Login Page again. What would be the reason, what steps I follow to keep login ...
Adeel Abbas's user avatar
0 votes
1 answer
51 views

Why does the $_GET parameter ?search forward the front-page to the archive/blog page

I need the $_GET parameter ?search for my front-page for a third party plugin. Whenever I enter http://wp-site.tld/?search=foo I get redirected to the blog/archive page. If I enter http://wp-site.tld/...
BonisTech's user avatar
  • 252
0 votes
1 answer
208 views

Detect if requested page is PWA on server side

I'm trying to determine if the user is browsing PWA on server side. On client side I can check if the browser mode is standalone via JavaScript and detect PWA, but on server side this is not an option....
DaftPlug's user avatar
0 votes
0 answers
56 views

Keep the old referrer after failed login

I have the following problem that I couldn't find any solution for. I have a simple custom login page, which I've managed to set up, so it redirects to the referred URL the user came from. The problem ...
uacnix's user avatar
  • 1
0 votes
0 answers
32 views

Information and Page from Wordpress Plugin

I couldn't really find the best solution for my problem - maybe I'm missing the forest through the trees. I developed a plugin that displays a html sign-up form for a newsletter. The collected info is ...
gladys's user avatar
  • 11
0 votes
0 answers
78 views

How to remove redirection

I have two sites in a local environment over Nginx server. superbiajuridico.test (site 1) quercusjuridico.test (site 2) These sites are very similar (same theme and similar content). WordPress showed ...
aitor's user avatar
  • 555
1 vote
1 answer
666 views

How to disable redirect on test/staging copy of wordpress site

This site I inherited runs a forum on a combination of Buddyboss and Buddypress. I've had to install ReCaptcha's on all user interactions, but I'm not happy with their layout and I'm suspecting ...
RolfBly's user avatar
  • 111
0 votes
1 answer
131 views

WP site after login keeps redirecting to looped url [closed]

My site Example.com keeps on redirecting to following url https://example.com/?redirect_to=https%3A%2F%2Fexample.com%2F%3Fredirect_to%3Dhttps%253A%252F%252Fexample.com%252F%253Fredirect_to%253Dhttps%...
Sandeep's user avatar
  • 11

1
2 3 4 5
9