Redirects the user to a specified absolute URI.

learn more… | top users | synonyms

6
votes
1answer
2k views

Pretty permalinks for search results with extra query var

I'd like to know how I can rewrite a search URL that also contains an extra query var into a pretty permalink using wp_redirect and the template_redirect hook. I have taken the code from the Nice ...
4
votes
2answers
1k views

Why is wp_redirect() preferable to a standard PHP header redirect?

In asking a question about hooks and redirects, I was advised to use wp_redirect in place of the PHP header function. Just wondering why wp_redirect is preferable?
3
votes
4answers
813 views

Using a Theme inside a Plugin directory

I am building a mobile friendly plugin and put the theme directory inside the plugin directory. If it's a mobile browser, how can I redirect to the theme in the plugin directory? ...
3
votes
1answer
1k views

redirect out of wp-admin, without losing admin-ajax.php

I'm trying to keep all non-administrators out of the Wordpress admin panel by using a wp_redirect inside of an is_admin conditional. The problem is that a side effect of this if that non-admins can no ...
3
votes
1answer
583 views

Redirect after deleting post and keep track of pagination

I have a custom post list in the admin panel. This list is paginated, so this is it's url : wp-admin/edit.php?post_type=xxx, if I open the default page wp-admin/edit.php?post_type=xxx&paged=n, ...
3
votes
3answers
369 views

Need help to repair a 301 redirect problem

I have been having problems with my website and as a result did a Crawl test in SEOmoz. The test found a 301 Permanently Moved Redirect of all the pages on the website and it appears that they are ...
2
votes
2answers
2k views

wp_redirect not working after submitting form

I'm using this redirect after inserting a post. It's not working, it only refreshes the page the form is on. I know the $pid is getting the post ID so what is the problem? This is the very end of my ...
2
votes
3answers
5k 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 ...
2
votes
3answers
2k views

How to 301 private posts rather than 404?

How do I 301 redirect private pages, rather than 404 them? If a post is private, WordPress filters it out in the SQL query, so there are no $post variables to work with. I'd like for this code to ...
2
votes
2answers
1k views

Redirect on successful login

I am using the following snippet to control redirects after successful logins.... add_action( 'wp_login', 'redirect_on_login' ); // hook failed login function redirect_on_login() { ...
2
votes
1answer
2k views

Force users to complete their profile after they register? How to

I am making a custom (quick) registration page in my wordpress site, to let users to register quickly by just filling username-email and choose their password. I have tpl-edit-profile.php, what ...
2
votes
2answers
1k views

Password change when the user login first time

I have a "change password" page. Is there a way to redirect that page when the user login first time using wordpress generated password? Thanks
2
votes
1answer
2k views

How to hide/redirect the author page

I have a website where I let people subscribe. I would like to only show the author page for actual authors who have written a post. I wrote this code that checks for post the problem is I can't use a ...
2
votes
1answer
66 views

How to set Active plugins as the default screen?

In my testing environment, I've got one hundred plugins. I'm more interested in seeing first the Active plugins than the complete list (All). How can I change the default screen for the Plugins menu ...
2
votes
1answer
370 views

redirect pages with no content, instead of 404 error, using max_num_posts?

I have a site that has changed its pagination structure, resulting in a huge amount of 404 errors (more posts are being shown per page than previously, so there are lots of pages that were once ...
2
votes
1answer
94 views

Redirect users away from Admin breaks ajax

Tried to make a simple redirect for some users I don't want to access the wp-admin/, so I did this code: function no_admin_access() { if ( !current_user_can( 'delete_posts' ) ) { ...
2
votes
2answers
1k views

Action wp_login_failed not working if only one field is filled out

I created a login form in the frontend with wp_login_form(). In my functions.php file I added an action to prevent the redirect to /wp-login.php if the login failed with ...
2
votes
2answers
818 views

How to use nonce with front end submission form?

Thanks to a variety of posts on here I've managed to put together a front end submission form. After about 24 hours of tweaking I've finally got everything working including a redirect to a 'success' ...
2
votes
2answers
1k views

How to Rename wp-login.php for Multisite?

I want to hide and rename wp-login.php in my URL for branding purposes on a Multisite set up. From this forum post I see that I can change mysite.com/wp-login.php to mysite.com/login by inserting a ...
2
votes
1answer
359 views

Can't get rewrite rules working

Basically I want to rewrite: /edit/test-post to an existing page with a parameter: /edit?e=test-post From the examples in the Codex I created: add_filter( ...
1
vote
1answer
2k views

wp_redirect not working in header, exit is breaking page

Sorry to ask such a basic question, I've looked at other questions and not found an answer. I've customized some public pages with their own header-public.php, and I'm doing a basic login check for ...
1
vote
1answer
1k views

Controller functionality - if user is not logged in send them to specific page (not wp_login)

This sounds dead bang simple, but I just can't figure it out. I want the following functionality: If user is not logged in and they try to access anywhere on the site (including the homepage) - send ...
1
vote
1answer
39 views

Multiple portfolios and single item in two of them (ideas?)

I’m creating a theme at the moment and has come to a point to decide what is the best solution to have implemented for a theme with multiple portfolios. If there is a project that is in the two of ...
1
vote
1answer
383 views

Problem with is_page & wp_redirect

I use cookies to determine which menu I should use on my website. This is working fine, but I want to force the correct one if someone views the URL directly instead of via the URL with a query string ...
1
vote
2answers
524 views

wp_get_referer not working properly after wp_redirect

Thank you for reading! There's a lot redirecting going on on the site I'm creating. For example, if not logged in user access a "private" page, he will be redirected to a custom login page. if ...
1
vote
3answers
4k 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 ...
1
vote
1answer
801 views

Can I change default registration link (without htaccess)?

I'm using url like «wp-login.php?action=register&role=patient» and «register_form» hook for add extra inputs form which depends on urls like this: ...
1
vote
1answer
55 views

Redirect if not logged in?

I've tried this to redirect people who aren't logged in to certain page. It ultimately shouldn't matter what front end page they visit, but should redirect to whatever page is chosen as the landing ...
1
vote
1answer
55 views

301 Redirect Code

I am currently trying to redirect a subdomain.blogger.com blog to a domain located on my hosted WordPress install. The code below is supposed to send a 301 redirect and then make that specific post ...
1
vote
1answer
81 views

blog url redirecting

I used to host a word press blog and a forum on a server (srv71) with a domain name. And a few days ago I transferred my whole site to a new server (srv14) but I havn't updated my dns and I've ...
1
vote
1answer
270 views

Using wp_redirect and .htaccess to re-route searches (and pass along the remaining GET vars)

I'm trying to use wp_redirect() to redirect searches to a format that I have established in .htaccess. Unfortunately, I'm running into some problems doing this. I need to redirect search to a series ...
1
vote
2answers
376 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 ...
1
vote
1answer
457 views

Redirect wp-login

I have a custom page called owner-login that has a wp_login_form() How can I disable wp-login.php so that: when a user writes wp-admin/ it will redirect him to the owner-login (if not logged) when ...
1
vote
0answers
94 views

Firing a function AFTER redirect

I am using a function that redirects the user to a custom page, rather than wp-login in the event of errors. In my case I am using the Http Referer function to send the user back to the same page ...
1
vote
2answers
1k views

How to do 302 redirects “in” WordPress using Redirection plugin?

I am planning to use the Redirection plugin to do redirects. The plugin's description states that it also enables 302 redirects, but I can't see how. There's no option as such (see screenshot below). ...
1
vote
1answer
81 views

Redirect outside WP after login

I have http://example.com/admin.php There I check whether the user is admin or not. If not, I send the user to the wp-login page like this: ...
0
votes
3answers
10k views

wp_redirect() function is not working how to solve this

wp_redirect($post->guid) is not working,how to solve this. this is my code: if(isset($_REQUEST['vid']) ){ $id=$_REQUEST['vid']; $post_title = 'sasa'; $post_content ='zxczxczxc'; ...
0
votes
3answers
3k views

wp_redirect “headers already sent” after front-end submission form

I'm trying to practice with setting up a front-end post submission form. And I'm getting this error: Warning: Cannot modify header information - headers already sent by (output started at ...
0
votes
3answers
356 views

Getting redirect to happen before header output

Anyone know of a way to trick WordPress into doing a header location redirect. I have to check whether users are logged in or not, and if not redirect them to our organizations authorization system ...
0
votes
1answer
321 views

Can Not Redirect from Plugin-Registered Admin Page

I am doing the following in my plugin: Register a custom admin page and in the callback function (the last parameter of add_submenu_page) Redirect to another page However, when I open the custom ...
0
votes
1answer
1k views

Headers already sent - Wordpress core

I'm getting an error on my site regarding "headers already sent": Warning: Cannot modify header information - headers already sent by (output started at ........./wp-admin/menu-header.php:161) in ...
0
votes
2answers
26 views

All links in WP blog redirect to main non-WP site

I worked on a Drupal site for a client, but he wanted to keep his blog on WP, so I manually created a 'blog' folder on the root of the Drupal site and moved all the WP content there. I uploaded the ...
0
votes
1answer
15 views

Redirect to Page URL for non-members

My membership plug in won't let me re-direct custom post type archive / taxonomy URLs to a non-member page if the user requesting access is not logged in or not a member. So, I am trying a hack to ...
0
votes
1answer
127 views

Redirect Attachment Page to Attachment

I'm trying to change my attachment page to just automatically redirect to the attachment. Here's what I've tried: Get attachment ID and redirect to that URL: $urlArr = ...
0
votes
1answer
49 views

HTML Redirect to WP pages

I have some predefined links that I need to redirect to real URLs within my WP install. I have NO CHOICE but to use these URLs provided to me, unfortunately. The format is: ...
0
votes
1answer
38 views

Some Pemalink problems, probably caused by wrong .htaccess configuration?

I have import on my local webserver a backup of a website made using WordPress but I am finding some difficulties with PermaLink configuration The main problem is that if I use the permalink setted ...
0
votes
1answer
121 views

WP Redirect is not working

I am trying to redirect to another URL using this code-- $siteurl= get_site_url(); //echo " This is basic property search.... now redirecting"; //echo "\n\n Redirect URL for property posts=" + ...
0
votes
1answer
31 views

How can I prevent redirects from mysite/page to mysite/wp path/page?

Apparently this is built into WP somwhere since going to mysite/wp-login.php takes me to mysite/<wp path>/wp-login.php (same for wp-admin and I presume other paths). The problem is, I don't ...
0
votes
1answer
130 views

block a page from logged out users and redirect to homepage

How am I blocking certain pages from being viewed by logged out users? I have some pages like a dashboard for example that each user has to display their posts an is found in the top level like ...
0
votes
2answers
147 views

How to redirect from one WP site to another

I want to set it up so when you click on a tab on my one site it redirects you to my other site. I've tried every code I can think of and nothing seems to work. Please help.