Redirects the user to a specified absolute URI.

learn more… | top users | synonyms

1
vote
0answers
15 views

Redirecting users based on custom user meta

I am novice trying to use the following code: function my_login_redirect( $url, $request, $user ){ if( $user && is_object( $user ) && is_a( $user, 'WP_User' ) ) { if( 'cool' == ...
0
votes
1answer
439 views

force login and redirect to custom login page

I am really desperate, looking for a solution for days now. I need to achieve: restricted access for logged in users only not logged in users need to be redirected to a custom login page I am on a ...
0
votes
2answers
533 views

wp_redirect giving a warning: Cannot modify header information - custom plugin

I'm trying to do a delete action in custom plugin which uses a custom table and extends wp_list_table for showing the data. The problem is, whenever I try to delete the data I get cannot modify header ...
1
vote
4answers
7k views

Redirect user after login/registration globally

How it possible to redirect all users, even administrators after login to specific page? And also redirect users after successful registration? Any simplest way? For example I want to redirect users ...
0
votes
1answer
933 views

Redirect after successful registration with fronted registration form

I am trying to redirect users after failed and successful registrations and logins. Everything works fine, except the redirection after a successful registration. Right now, I get redirected to http:/...
0
votes
1answer
17 views

Delete post: 2 wp_redirect if pages are different

My website allows users to publish and manage posts from frontend. I've created a kind of account section where they have all their posts published which they can edit and delete. They can even delete ...
0
votes
1answer
60 views

How redirect after registration?

I have 2 different pages one is for employee and other one is for employer , After signup I need to redirect page based on user role:- If user role is employee redirected to employee page OR ...
1
vote
3answers
624 views

Unable to get wp_redirect() working after adding a CPT via the front end

I am attempting to learn PHP by creating a relatively simple application built on wordpress, it is a basic CRM and I've made decent progress but have been stuck on some of the finer points. I've been ...
0
votes
2answers
107 views

Clone a Post Tite and Custom Field into Custom Post type

I am using Simple Urls to setup redirects on my blog. I am trying to create redirects automatically upon publishing a post. For example, If i publish a post about StudioPress it will be automatically ...
0
votes
0answers
15 views

The custom “Delete Post” button works only on second time you click it

I created a delete button on frontend for blog posts and custom type posts and I would redirect to a specific page after deleting them. The code that I used for the deleting url is: add_query_arg( '...
0
votes
3answers
27 views

Redirect to login page

I am new to wordpress. I am running wordpress setup on http://localhost/wordpress/. I am facing two problems right now: Only the logged in users can access the site. So, I am trying to redirect the ...
0
votes
1answer
30 views

wp_redirect only works on main site and not on other sites

My main site is https://www.domain.com/, all my multisites will have https://www.domein.com/multisite1/ link. I made a function in functions.php which will check if the option (in the admin panel) is ...
0
votes
0answers
23 views

Redirecting users to unique pages NOT based on their role

I'm looking for a way to redirect users to individual WooCommerce product pages based on a custom identifier. My website uses W2Member to control access to the site and I have a number of different ...
2
votes
0answers
35 views

Using a custom field value to redirect away from a 404 page

I’m moving from an old CMS to WordPress. The old articles are saved as posts and the new WordPress permalink is %post-id%. The old URL slug is unique and saved as a custom field for each post; the ...
1
vote
0answers
22 views

wordpress_redirect returns different headers for HEAD and GET requests

There's an odd behaviour I just noticed during some tests we're doing on one of our sites. We're verifying if the user isn't logged in and perform a wp_redirect in our theme's header.php like this: ...
0
votes
0answers
32 views

Mutisite subdomain redirecting to wp-signup.php

This appears to be common problem, but so far all the fixes I have googled do not appear to work!!! I have a main site www.suttonscouts.org.uk and wish to create a subdomain 1nw.suttonscouts.org.uk ...
0
votes
0answers
39 views

301 Redirect on wp multisite

I have tried to follow instructions see on couple of discussions and none of them seem to work . I have a domain viraleditorial.com and its running multisite network. I have subsite monarch....
0
votes
1answer
123 views

Redirect missing pagination to base page

I have a strange problem with wp_redirect that I can't seem to solve myself. I'm trying to redirect previously existing pages back to the root of the page so: http://example.com/slug/page/5/?sort=no-...
0
votes
1answer
58 views

Why does not this wp_redirect work in is_single()?

I have a custom post type (portfolio) and I have to redirect a certain page (of this custom post type) to another page. when I look at my custom post type page: So I wrote the code as follow to ...
0
votes
2answers
24 views

Strange redirect behavior after moving development site to client server

So I moved a Wordpress site I've been working on for a client to the client's host, setting up the installation in a subdirectory and planning to set the site address to the domain name once ...
0
votes
0answers
17 views

How do I redirect /search/ to ?s=

I have a Search page set up which uses the typical GET format <form id="searchform" action="http://example.com" method="get"> <input id="s" type="text" name="s" placeholder="...
0
votes
1answer
24 views

Redirect User From Registration Page To CPT (profile page) with custom url

I am looking for a little advice regarding wp_redirect after successful registration, the plan is a new user registers and is then re-directed on success to a custom post type page 'Agent' wp ...
0
votes
0answers
40 views

infinite loop wp_redirect

i'm building a website but i encountering some troubles i'm getting an infinite redirect using wp_redirect to a custom login page here is the code : require_once('form-template.php'); ...
0
votes
1answer
44 views

Passing User Messages to Another Page

I've got a form that does a fair bit of processing. Along the way, things may not work out as expected, and I want to display messages to the user. I've got that working. However, if things go well, ...
0
votes
0answers
57 views

Warning: Cannot modify header information - headers already sent

My WordPress redirection is not working, I'm getting this error: Warning: Cannot modify header information - headers already sent /wp-includes/pluggable.php on line 866 I am using this code ...
0
votes
1answer
22 views

Multisite setup help - plain domain/subsite always redirects to domain with subdir multisite

I set up a path-based wp multisite using subdirs for each site. It all works well except if the subsite is accessed without www. For example - //mainsite/subsite always redirects to //mainsite" //...
0
votes
3answers
430 views

Redirect from the dashboard to edit.php if wp_is_mobile() is true

Looking for a way to redirect the user from the dashboard straight to edit.php if wp_is_mobile() is true. This is what I've tried: function redirect_if_mobile() { $screen = get_current_screen();...
0
votes
0answers
51 views

Woocommerce product option redirect to other product

I'm looking for a solution in woocommerce in a gateway that doesn't accept variable products. =( I have 3 products. Each one has 2 sets of 3 options So in product A: Option 1 - A | B | C Option 2 - ...
1
vote
0answers
32 views

Remove #wpcf7-f2450-o1 with Contact form 7 redirect

This is what I'm trying to do: I have a contact form, when the form submits I want to redirect to the page http://example.com/thankyou?c=thisisavariable . I can redirect, the problem is he redirects ...
0
votes
3answers
2k views

How to redirect non-logged in users to login with post_password_required()

I have created a membership site which is working how I would like in that non-members cannot view private pages. However, I want that when someone who has not logged in, clicks on a link that links ...
0
votes
0answers
28 views

Redirect Attachment to parent or homepage not working on Firefox

to prevent attachment pages to be indexed in SERP, I usually use the option in Yoast SEO plugin to redirect attachment to post parent page. But it does not work when an attachment has no parent, that ...
0
votes
0answers
28 views

wp-login via woocommerce (with redirect information)

I have a wordpress install (example.com), where users login with woocommerce at example.com/my-account instead the default wordpress-login page. I furthermore run a discourse-install on another ...
0
votes
0answers
15 views

How can I stop 301 Redirects on sub-domains?

I have a single-site installation located at: www.mysite.com. I have also created sub-domains VIA cpanel for development, eg: dev.mysite.com, it's mapped to a different directory on the ...
0
votes
4answers
24k views

wp_redirect() function is not working

wp_redirect($post->guid) is not working. How can I fix this? This is my code: if(isset($_REQUEST['vid']) ){ $id=$_REQUEST['vid']; $post_title = 'sasa'; $post_content ='zxczxczxc'; ...
0
votes
1answer
158 views

how to use wp_redirect inside a function

I have the following action and function. Ultimately i'm trying to get access to value $processArtwork in my template. One option is pass the value via the querystring. However the following results ...
0
votes
0answers
33 views

Wordpress Multisite htaccess redirect loop

I have a multi-site instance of Wordpress setup for a series of related websites. These work on a sub-directory approach (e.g. domain.com/team-events/). Within one of the sites, I have created a ...
0
votes
0answers
26 views

How to redirect deleted pages

I had several posts about individual books, which I combined to a post featuring all the books together. Now I want to delete and redirect those individual book posts to the combined post. I just ...
0
votes
2answers
24 views

How to make custom Wordpress page deliver search results

I have customised the standard Wordpress search.php and everything is working fine. Now, my client would like to be able to add some content to the beginning of the search results page in the same ...
0
votes
0answers
32 views

How to identifty post from its URL in 404 page?

Why GUID is such unstable? Some of the post's GUID are pretty permalinked, but most of them are default. I's using Pippin's function to get the post_id from its GUID, but it's not working if my site ...
0
votes
1answer
33 views

A way to redirect users when they log in based on their current page

I have a number of pages that are only viewable to users who are NOT logged in. I have a widget that allows users to sign in. I am trying to find a way for users who sign in whilst on these ...
0
votes
0answers
103 views

redirect to a users only page after login success

I have a page built that checks if a user is logged in before they can view the page. It uses the code below: if( !is_user_logged_in() ) { wp_redirect( home_url('/wp-login.php') ); } Now in my ...
0
votes
1answer
95 views

Force SSL on a single page which is used as iFrame

I have one WordPress page that only contains a shortcode for a slider and is used by other websites as an iFrame. I need to force SSL one this one single page, but whatever I try, it is not being ...
0
votes
0answers
134 views

Redirect based on $_GET parameters

I'm coding a payment gateway plugin for a webshop. I'm having trouble redirecting the users to two different pages based on the order status. In the payment sent to the gateway I can add one ...
0
votes
0answers
25 views

Proper way to set author pages at root?

I want to create landing pages for each user on my site in the same URL structure as most popular social networks: sitename.com/username But of course, I don't want to create pages for each user. ...
0
votes
1answer
105 views

Hide Author page from others

I am using author.php as an Author page. I have changed the author base slug to "profile" so a post author can view their author page at website.com/profile/name As these are basically personal ...
2
votes
3answers
5k views

wp_redirect() - headers already sent

I am trying to use wp_redirect() to redirect the user after successfully submitting a signup form on the page. It's not working and shows the following error: Warning: Cannot modify header ...
0
votes
0answers
128 views

How to get wp_redirect to work correctly

I have a new site that has had a permalink structure update. Old Structure: http://blog.mysite.com/%postname% New Structure: http://blog.mysite.com/%category%/%postname% My thought process was to ...
0
votes
2answers
69 views

Use wp_redirect to add a parameter

I am trying to add a function to my child theme to append the currently logged user as a parameter. For example, when the user test1 logs in and clicks on the following page: http://www.example.com/...
-1
votes
2answers
834 views

How we redirect to other pages in WordPress?

I am using an onclick function to redirect the user if they are not login. I am calling a php function in achor tag like this <a href="#" class="fright hrtacnhor" onclick="<?php checkstatus(); ...
1
vote
1answer
197 views

Getting “too many redirects” when using wp_redirect for attachment page

Code comes from the codex: <?php wp_redirect( get_permalink( $post->post_parent )); exit; ?> I added the above, in an empty attachment.php page. When I visit an attachment page (eg. http://...