Questions tagged [wp-redirect]

Redirects the user to a specified absolute URI.

Filter by
Sorted by
Tagged with
0
votes
1answer
17 views

How to customize file path for 404 redirection in php?

I made a plugin with a custom post type postcard. Most of postcards are private. I would like to redirect the logged out user in a specific php file inside my plugin instead of the 404.php or achive....
0
votes
1answer
10 views

How to 301 redirect sub domain post URL to root domain

We have a subdomain which is implemented in WordPress: https://blog.aisee.co.in/ and it has more than 2000 posts in it. As per SEO perspective, we wanted to migrate the subdomain to the main root ...
0
votes
0answers
17 views

Can't redirect a 404 page using plugins

I changed a permalink on my Wordpress site which was previously set as index.php/%postname%/ to /%postname%/ Since my site pages are already indexed, people get 404 pages now. I tried redirecting ...
0
votes
1answer
25 views

How Do I Redirect a Wordpress Website?

I have a staging Wordpress site with HostGator at http://subdomain.domain1.com (This is not the actual domain, however it is a subdomain of an existing domain.) I purchased a new domain from ...
1
vote
1answer
20 views

Redirect /%year%/%monthnum%/%day%/%postname% [closed]

Need to redirect to new structure /%year%/%monthnum%/%day%/%category%/%postname% Saw code that helped before but can't seem to find it. Updated theme and lost the code that went into functions.php. ...
0
votes
0answers
17 views

How do I set another domain for WP automatic redirects that is not the default domain?

I just migrated my blog from subdomain to subfolder. Then, I realized some old permalink changes on my blog posts are not redirecting correctly. The thing is, when in WP admin, my domain looks ...
0
votes
0answers
12 views

Prevent non-existing CPT to redirect

I'm using a CPT articles. I would like urls like ./articles/2186 to be able to exist even if i don't have any CPT Article with 2186 as slug. No 404, no redirect, just loading the correct single-...
0
votes
0answers
15 views

stop redirection on /wp-login

I've installed a modified version of Wordpress with "Duplicator" There is a problem loading the page I think it's in the redirection How can I stop it? http://mysite/wp-login.php?redirect_to=http%3A%...
0
votes
0answers
23 views

Redirect Child Category to Parent Category Post Permalink

I changed my permalink structure to /%category/%postname/ and its okay, My site post permalink is now https://example.com/categoryname/postname/ Now the issue is, I am having child category, It ...
0
votes
2answers
88 views

Is this a correct usage of ob_start() in my WordPress project?

I have extended WooCommerce to create a custom endpoint. This endpoint, points to a template that has a form to save user meta data. When the form is submitted I want it to redirect to another URL. ...
0
votes
0answers
10 views

Code custom redirect url after woocommerce registration

I'm trying the code for redirect url after registration, but its not working. I tried other options, I used the plugin, but it's same not work. I use registration form in "my_account" page. Could ...
0
votes
2answers
12 views

Why https://www. SUBdomain is redirected by WP to https://MAINdomain

Hi there could somedoby explain please why https://www. SUBdomain does not redirect to https://non-www.sudomain I am running nginx and seems like set up all the redirects but the one above seem to be ...
0
votes
0answers
10 views

Taxonomy in taxonomy permalink structure

I have a custom post type advert and two taxonomies advert-category and advert-location. By default it looks like: .../ads/advert-category/ archive for categories .../place/advert-location/ archive ...
0
votes
3answers
55 views

Redirect after login based on user role (custom login page)

I created a custom login page and everything is OK but there is an issue. I want to redirect users to different pages based on their roles after login. My code is below but I do not know why it is not ...
0
votes
1answer
47 views

How to auto login after registration? [duplicate]

I create an user using $user_id = wp_create_user($username, $password, $email); After creating the user I want them to auto login and so according to ravi patel, I have added the following code in ...
0
votes
1answer
16 views

Unable to properly login

First of all, sorry if the question is not clear the first time, it's a bit tricky to explain. Here's the issue i've got: I have a website running locally with mamp pro. Site name is dev.site (the ...
0
votes
1answer
37 views

Redirect website domain (including all pages) to external URL after Popup message (few seconds)

I am new to wordpress and I have made custom code as below. Where I can place this custom code in wordpress. I want to redirect the website domain and all pages but wanted to display popup message for ...
0
votes
1answer
25 views

Disable Wordpress URL auto Redirect

Wordpress auto redirect http://example.com?lang=fa to http://example.com/?lang=fa how to stop that?
1
vote
1answer
17 views

Redirect user to previous page after signup from custom form

I've looked on here and found lots of references to this, but none have worked for me, probably because there must be something in the custom code I am modifying that I don't quite understand. Having ...
0
votes
1answer
15 views

Overiding wp_santitize_redirect for | character

I am not really conversant with php and I have an issue with wp_sanitize_redirect. I have seen this excellent question and answer: wp_sanitize_redirect strips out @ signs (even from parameters) -- ...
0
votes
1answer
29 views

Problem in redirect link in wordpress

I created a login page in wordpress and redirected the page to another website . Now, after clicking the login icon from the menubar it redirects to another page. Thats fine. But I cant access the wp-...
1
vote
1answer
135 views

WordPress Redirect Not Working - AJAX Callback Response Not Picked Up

I cannot get a redirect working in my custom wordpress plugin. I have a button on a page which triggers an AJAX action which calls a function. In my function (which is definitely being called as I ...
0
votes
0answers
21 views

How to redirect attachment page to actual file URL

I have a minor problems with my blog. When I click on attachment page, it automatically redirect to the actual file attachment. For example: When I click on: http://localhost/blog/my-media-file ...
0
votes
1answer
14 views

saving variables after redirect

Is there a way to save a variable after you redirect to another page. For example... I want to save the password submitted from my form into the variable $temp_passkey, and be able to access it on the ...
0
votes
2answers
22 views

wp_redirect doen't work

I am writing a simple plugin to accept a user number, show a form with information about the user, then post a payment amount. The user number is obtained from this http file include_once(...
1
vote
1answer
391 views

header and wp_redirect not working. cannot modify header information warning

Does anyone know another way to redirect without header(); giving me this error? wp_redirect doesn't work for me either... This is the error I'm getting: Warning: Cannot modify header information -...
0
votes
0answers
12 views

how to redirect folder and its subfolders to subdomain

i have a wordpress blog and i have changed my "uploads" folder to subdomain. My previous address was like this. https://guilaneman.ir/wp-content/uploads /.../.../ my new url: https://images....
0
votes
0answers
19 views

Non-www is redirect to admin page

The website is redirecting domain.com (non-www) to the admin login page. I don't want that. www.domain.com is showing the website in a correct way. Anyone knowing the problem with the non-www ? ...
0
votes
1answer
113 views

Php function 301 redirect

I am using this code so that when the user visits the old permalink, he gets redirected to the new one. add_action( 'template_redirect', 'redirect_to_external_url' ); function ...
0
votes
0answers
21 views

Redirect problem on login page

I've create a custom page with a login form but I have a problem. When try to login I automatic redirect to my same login page (in my case I have the form on home page) and ULR change from www.mysite....
0
votes
1answer
36 views

Detect what link user clicks and Redirect to a specific page for logged in users only

I have a link in my WP website Account link. I would like this to work normally for logged out users. However for Logged-in users i would like this link to take them to another page url. I have tried:...
-1
votes
1answer
43 views

Redirect specific link for logged in users only to specific URL

i have a custom Woocommerce link that adds a product to the cart and redirects user to the account page: account/?add-to-cart=15169 I'd like this link to redirect only logged-in users to some ...
0
votes
2answers
444 views

main-domain of wordpress keep redirecting to subdomain

I was in process of deploying my wordpress website mysite.com/NewSite to mysite.com during the deployment I messed up something and my main site has started redirecting from mysite.com to mysite.com/...
-1
votes
1answer
213 views

Cannot modify header information - headers already sent

So I have a form on one page, which is submitting to admin-post.php, then there is a function in functions.php which is processing the form. It stores the input field data to database and then after ...
0
votes
0answers
121 views

wp_redirect() function does not redirect to another page

I have a form on one page and submit it to admin-panel.php, where in functions.php I have a function which takes the input data, stores it in database and then the user should be redirected to another ...
-1
votes
1answer
364 views

show payment receipt in woocommerce thankyou page with custom payment gateway?

I'm developing a payment gateway for WooCommerce with my client's bank that provides an API and actually I can process the payment correctly, but I need to show the transaction receipt in the thankyou ...
1
vote
1answer
45 views

Redirect a page based on last word in slug

I have a couple custom post types registered = Staff, Properties If I have a page with the slug archive-staff, how can I automatically redirect that page to the Staff CPT archive page with a php ...
0
votes
1answer
11 views

Internal redirect from page to category

I want to implement a page, let's say /today-deals that will show all posts under today category, like if we were navigating to /category/deals-for-october-31-2018 but without changing the URL.
0
votes
0answers
43 views

Frontend registration form doesn't save data only redirects to wp-login

I have another wordpress dilemma... I've built a frontend registration form, but for some reason whenever a user tries to register it doesn't work, and they get redirected to wp-login.php. The ...
0
votes
1answer
71 views

Redirect regex misbehaving when placeholder empty

I have the following 2 redirects active: /code-examples/(.*) -> /tutorials/android/$1/ and /code-examples/android/(.*) -> /tutorials/android/$1/ The first one has a higher position, so the ...
0
votes
1answer
236 views

Redirect to first child in menu

I have the following page hierarchy: Page Grandparent (This page) Page Parent 1 (Should direct here) Page Parent 2 Page Child Page Child Page Parent 3 Page Parent 4 My parent and child pages have ...
0
votes
1answer
21 views

Wordpress Redirect After logging

The following code below allows to me authenticate user against a custom table I created: function authentication($emailAdd, $password) { include_once('././wp-includes/class-phpass.php');...
0
votes
1answer
41 views

How to after saving or publishing a post redirect back to the original page

When viewing a list of posts on the admin page wp-admin/edit.php I click on edit. I then finish editing the post, click on save or publish and expect to be returned to the original admin listing page ...
0
votes
2answers
63 views

So how to redirect category to a page of the same name if it exists?

So I had previously tested a specific redirect where I knew the page exists. function nepal_template_redirect() { if ( is_category( 'nepal' ) ) { $url = site_url( '/nepal' ); ...
0
votes
1answer
25 views

How to fix automatic redirects?

All page links of my wordpress website are automatically redirecting with additional string which looks like this "/#.W6nTIaV-7pE" eg: https://supremeip.com/Trademark https://supremeip.com/Trademark/...
0
votes
1answer
103 views

“Cannot modify header information” means I can't use wp_redirect

I am working on a site where new users are expected to agree to read our site policy before they can proceed. Once a new user logs in, they are redirected to the policy page. To continue to the read ...
0
votes
1answer
16 views

Redirect /member/ to /member/user

Is it possible if an user is loggued to redirect /member/ to /member/user ? (User is the display_name) If yes, how can I do this ? Thank you ! :) thanks to Jack, I tried to search on google "Wp-...
0
votes
0answers
14 views

wp_redirect not working when adding custom fields

I am trying to redirect when the admin clicks on the "Draft" button. The code is below $draft_txt_change = 0; function test_post_status(){ global $draft_txt_change; $year = date("Y"); $month = date("...
0
votes
1answer
171 views

Custom URL redirect in WP

I am trying to make my own redirect page for external link. My target My target is that, when a user open the link www.mysite.com/wp/GoTo/?URL=www.google.com, the browser open the page www.google....
0
votes
0answers
153 views

wp_logout() not working after form submission

I am pretty new to Wordpress, so please forgive me if this sounds like a silly question. I have a Wordpress Page which is using the default page.php template in my theme. I modified the page.php ...