Questions tagged [wp-redirect]

Redirects the user to a specified absolute URI.

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

GCP & Wordpress: Domain redirecting to external ip instead

I have purchased domain in Godaddy and hosting in Google Cloud Platform with external ip of 34.106.155.119. It is a wordpress VM instance. I tried to point the domain name to external ip by changing A ...
Indu Priya's user avatar
0 votes
1 answer
20 views

Wp Redirect Not Working Can u Help

Hey I developed a form in which user will add detial and it will send email to the team using wp mail. Now i have two issue one is i am having redirect issue i want to redirect user to back page after ...
waqas023's user avatar
-1 votes
1 answer
31 views

Wp redirection doesn't not change url in browser

I'm writing a WatuPro plugin customization. I need to redirect users to specific url when an exam is completed. I have to do it by code because i need to attach some dynamic get parameters to the ...
user31929's user avatar
  • 101
0 votes
0 answers
5 views

Redirecting user based on the query parameter passsed on the login screen

https://site/login?tokenreq=https://thirdparyt.com/docs/file.pdf Based on the tokenrequest parameter how to redirect to the file.pdf link So far tried function your_function( $user_login, $user ) {...
mike's user avatar
  • 1
0 votes
0 answers
43 views

Bulk Redirect WordPress Posts to Category based URL after Permalink Structure is Changed

function custom_category_redirect() { // Get the requested URL $requested_url = esc_url_raw(add_query_arg(array())); // Get the permalink structure $permalink_structure = ...
WordCent's user avatar
  • 1,827
0 votes
1 answer
20 views

Redirect after registration and auto login is not working

the user can register on the frontend form, and will be auto logged in after submission. Then he should be redirected to a custom URL, but the redirect is not working. // Shortcode für das ...
LovinQuaQua's user avatar
0 votes
1 answer
232 views

How to stop wordpress from redirecting from the post's old slug after changing title and slug?

After changing a post's title/slug from mysite.com/name to mysite.com/new-name, the old slug mysite.com/name is now redirecting to the new one mysite.com/new-name, and I don't want that to happen. I ...
cashrunner's user avatar
0 votes
0 answers
25 views

Changing the redirection of a restricted url

I've almost finished setting up a website as a complete laymen and i used a function posted on here that allows hyperlinks to be only visible to logged in users. The function works completly fine, all ...
Benjamin's user avatar
0 votes
0 answers
45 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
59 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
60 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
147 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
737 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
544 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
  • 41
0 votes
2 answers
267 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
46 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
119 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
111 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
75 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
99 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
1 vote
1 answer
52 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
1 answer
135 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
1 answer
36 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
653 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
473 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
40 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
28 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
1 vote
1 answer
855 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
118 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
41 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
698 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
699 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
2 votes
2 answers
1k 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
135 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
  • 327
0 votes
0 answers
396 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
196 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
111 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
1 vote
2 answers
150 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
244 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
212 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
881 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
413 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
252 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
41 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
237 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
56 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
  • 262
0 votes
1 answer
241 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
61 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
33 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

1
2 3 4 5
9