Skip to main content

Questions tagged [wp-redirect]

Redirects the user to a specified absolute URI.

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

How to prevent random 302 canonical-ish redirect on custom template

I'm trying to create a subpost location - like /embed or /feed - for photo galleries. // this defines the location logic if (!function_exists('is_gallery')) { function is_gallery() { $uri = $...
lucian's user avatar
  • 322
0 votes
1 answer
8 views

Where does the redirect from shortlink to permalink happen?

When requesting short urls they are redirected to their matching permalink, for instances : shortlink permalink /?cat=category_id /category_base/category_slug /?p=post_or_page_id /custom_structure/...
challet's user avatar
  • 111
0 votes
1 answer
24 views

Where to add wp_redirect on frontend pages?

My main problem, that I generate forms based on data coming from the init hook. I cannot do it earlier because I use get_current_user_id to check which posts belong to the current user and the form ...
inf3rno's user avatar
  • 135
0 votes
0 answers
10 views

Redirect not logged in users but exclude 1 page

I have the below code in the header.php to redirect not logged in users to the home page and it works great but a bit to well as it stops not logged in people accessing the terms and conditions that ...
Jonathan Blindell's user avatar
0 votes
0 answers
25 views

Setting up a redirection

I am trying to use WordPress's redirect feature to setup a redirect for the following. I can successfully get redirects to work from a page to another page or a page to a PDF in the media. I can't ...
Michele Kleinhomer's user avatar
0 votes
1 answer
25 views

Redirection - bulk edit 404s to new tomain

Please help. I moved all (1500) posts from one category to a new domain. now I have a lot of 404 errors for posts and images. Trying to use Redirection, so I'm on the 404 page, bulk edit select all ...
Will Sher's user avatar
0 votes
0 answers
20 views

Create a page and redirect to it after

The following function is called in an ajax callback. When I click a button in the front end it should create a new page and immediately redirect to it. The page is created, however no redirect ...
Horizzons's user avatar
0 votes
0 answers
39 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
24 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
84 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
53 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,877
0 votes
1 answer
33 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
582 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
1 answer
140 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
3 votes
1 answer
173 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
2k 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
  • 139
0 votes
0 answers
776 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
  • 83
0 votes
2 answers
485 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
1 vote
0 answers
183 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
102 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
129 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
72 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
171 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
  • 15
0 votes
1 answer
40 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
765 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
560 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
41 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
31 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
  • 265
1 vote
1 answer
1k 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
148 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
67 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
975 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
872 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
2k 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
211 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
  • 337
0 votes
0 answers
576 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
246 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
126 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
165 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
257 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
245 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
1k 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
489 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
333 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
50 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
255 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
58 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
  • 272

1
2 3 4 5
9