Redirects the user to a specified absolute URI.

learn more… | top users | synonyms

0
votes
1answer
400 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 ...
0
votes
1answer
822 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 ...
0
votes
3answers
405 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 = ...
1
vote
3answers
579 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
0answers
18 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
16 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
1k 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
11 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

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
11 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
21k 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
45 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
21 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
19 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
21 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
27 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
31 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
53 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
50 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
59 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
20 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
63 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 ...
1
vote
3answers
3k 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
73 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
35 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: ...
-1
votes
2answers
703 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
80 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. ...
0
votes
1answer
49 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
46 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
51 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
88 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
200 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
68 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 ...
0
votes
0answers
139 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
195 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
151 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 ...
0
votes
1answer
87 views

template_redirect to accompany with a shortcode

In one of my plugin's shortcode I'm handing user login / registration on the fly with a post submission. So the whole thing is happening within the shortcode like: <?php function this_shortcode() ...
0
votes
1answer
119 views

Wp redirect to url with ampersand string

i have a url like this: www.url.ui/?keyone=valueone&keytwo=valuetwo&ekythree=valuethree stored in a variable: $url = www.url.ui/?keyone=valueone&keytwo=valuetwo&keythree=valuethree ...
0
votes
2answers
714 views

wp_redirect hangs, but returns true

I have no idea what I'm doing wrong, but I can't get the wp_redirect to actually redirect the page. I enabled the wp_debug to check for "header already sent" errors, but nothing. I installed the ...
4
votes
3answers
7k views

Where does wp_redirect need to be placed to make it work?

I've got a front end post editing page located at mysite/post_id/edit and am trying to redirect users that are not the author back to the post. Here's the code I'm working with: <?php ...
0
votes
1answer
212 views

Use Parent Pages for URL Structure without Landing Page

So this is more a philosophical question than anything, and if I'm asking this in the wrong place, I'm happy to remove the post: What's the best way to use a parent page for structure while keeping ...
0
votes
1answer
44 views

How to display post in custom file not in archive file?

I create file content-expertises.php and display my category list. Now, When I click one my category name, it is redirect in category.php file not my custom created file like category-expertise.php. ...
0
votes
1answer
525 views

Front end posting

This source works with image upload. Without image upload, it works, but 'redirect' doesn't work. What should I do?? Any suggestions to what the problem might be? if( 'POST' == ...
0
votes
1answer
323 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
329 views

Is it possible to wp_redirect() to a new tab?

Is it at all possible to set up wp_redirect() so that it redirects to a new browser tab? If so, how can it be done?
-1
votes
4answers
224 views

Redirect page URL to home URL without using a plugin

How do I redirect this page URL, http://localhost/wordpress_rnd/?page_id=2, to the home URL, http://localhost/wordpress_rnd/, without using any plugins?
2
votes
1answer
146 views

Password protected page Hash url

I am using owl carosel which takes a hash url to go to a specific slide (http://www.owlcarousel.owlgraphic.com/demos/urlhashnav.html#five) Lets say I want to visit a password protected page with the ...
0
votes
0answers
110 views

Does wp_redirect keep the referrer?

I'm monitoring traffic from Google, and if the traffic source is google, I want them redirected to the same URL, but with an appended GET variable, such as http://example.com/article should be ...
0
votes
1answer
76 views

How to Manually Upload Files via FTP

I am helping a friend who has a site self-hosted via Wordpress. They have access to their FTP. Now I am familiar with manually updating files through the FTP and that is how I usually update my sites. ...
0
votes
3answers
216 views

Missing domain http://./wp-… in redirects

I am migrating my WP website from staging to production and I have a problem with Dashboard access. When I try to access http://<domain>/wp-admin.php it redirects me to ...