Redirects the user to a specified absolute URI.

learn more… | top users | synonyms

0
votes
0answers
14 views

Redirect non logged in users from all pages with a certain parent

I am using the following code to add a redirect for non logged in users on a certain page: add_action( 'template_redirect', 'redirect_to_specific_page' ); function redirect_to_specific_page() { if ( ...
0
votes
0answers
14 views

Redirect Rule: Directing a Subpage to a Subdomain

I've been doing a lot of reading, but am still new to Wordpress, so sorry for the confusion here. I have a multisite that I need to do a redirect for. I'd like a mainsite.com/example page to redirect ...
4
votes
2answers
78 views

How can I put a wp_redirect into a shortcode?

I have a typical shortcode which prints some html on a page. The shortcode will only be used on pages where visitors are logged in. As a separate operation, I've been using a custom field to trigger ...
0
votes
1answer
24 views

How do I redirect a permalink for a Draft post to a custom 404 page?

My users create posts with links to future posts which are in Draft status. We use Post Name as our permalink structure. Eg. <a href="/future-draft-post">Here is our next fantastic post ...
1
vote
0answers
22 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
24 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
62 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 ...
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
31 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
35 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
25 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
38 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
23 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
42 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
67 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
18 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
47 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
2answers
110 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
1answer
58 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
58 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
24 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" //...
1
vote
0answers
39 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
0answers
30 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
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
1answer
187 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
34 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
28 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
123 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
100 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
155 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
108 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 ...
0
votes
0answers
155 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
87 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
vote
1answer
215 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://...
0
votes
1answer
100 views

URL rewrite before template_redirect called

Logic I have a page template at /blog that contains a "public" blog. I have a page template at /members that is members area. If a user enters the URL /members/blog I want to catch this in the ...
0
votes
1answer
76 views

Add action “page_template” not work with home page

add_action( 'page_template', 'fw_reserve_page_template_pending', 99 ); function fw_reserve_page_template_pending( $page_template ){ $page_template = /* My template Path */ return $...
1
vote
1answer
83 views

How to pass a message using template_redirect

I'm using the following function to redirect a post to another using custom field. It's working just fine until I added the line#8 to pass an ID so that I can grab it in to the post (to where was ...
0
votes
1answer
111 views

Manually Create PHP Page For A Redirect

I am new to wordpress and working on something for a friend, I have FTP access, and am trying to upload a php file, that checks the platform and redirects the user either to the iTunes store if they ...
1
vote
1answer
341 views

is_user_logged_in not working to redirect only logged out users

So I have the code below in my functions.php file. It works for logged out users but it also redirects users that are logged in. Can anyone help? add_action( 'template_redirect', '...
0
votes
1answer
126 views

Perform a redirect after user action

Is it possible to redirect a user in WP without the header/wp_redirect being before header()? I have a plugin that allows users to manage content they have created on the site... for example, they ...
1
vote
0answers
206 views

How to wp_redirect on 'init' hook on condition of current post id?

I have made a shortcode, because we can't redirect page within shortcode using wp_redirect so I used 'init' hook to check the $_POST/GET parameter and make system redirect. But I'm stuck in a ...
0
votes
1answer
315 views

Use wp_redirect without filter in plugin file

I created a little private plugin for me, which contains a form, that saves data to a database. Every user should only have one dataset. If he already has one, he should only be able to edit his ...
1
vote
3answers
277 views

Show different page for first time user

As per my requirement I need to show a page say firstpage.php for user who visit my site for first time else should show home page say homepage.php I created both this pages as page-templates For ...