Redirects the user to a specified absolute URI.

learn more… | top users | synonyms

3
votes
2answers
5k 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 ...
0
votes
1answer
156 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
336 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 = ...
2
votes
1answer
488 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
114 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' ) ) { ...
1
vote
1answer
2k 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
1answer
773 views

using wp_redirect to redirect to a permalink

I'm using wp_redirect to change the URL of my 404 page: function show_404($message = 'page not found'){ wp_redirect(home_url() . '/error/404?m=' . urlencode($message)); exit(); } I have ...
1
vote
0answers
109 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 ...
0
votes
1answer
76 views

wp_redirect and search engine bots

I have some pages and categories you have to be looged in to have access to. I am using wp_redirect to send anyone who is not logged in to the front page if they try to open those pages. Is it enough ...
0
votes
2answers
698 views

wp_sanitize_redirect strips out @ signs (even from parameters) — why?

In my wordpress site I have a hack that looks at the uri and does a redirect to a subdomain. The problem is wp_redirect calls wp_sanitize_redirect which will strip out @ signs, so when a user tries to ...
2
votes
2answers
1k 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' ...
0
votes
2answers
153 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.
0
votes
1answer
121 views

Redirect within wordpress template/plugin

I've done a bit of googling, searching on forums, etc, and can't find a good answer. Here is what I'm doing: I need to pass a variable in the url to the page and have a rewrite to make it pretty. So, ...
2
votes
2answers
2k 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 ...
1
vote
2answers
2k views

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

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). ...
0
votes
1answer
1k views

How To Only Allow Users To View Their Own Buddypress Profiles? [closed]

I am currently developing a social-network sort of site using Wordpress + Buddypress and the client has asked that profile pages not be publicly visible for the time being. Basically the client is ...
3
votes
3answers
657 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 ...
3
votes
3answers
6k 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
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 ...
0
votes
2answers
261 views

Redirect the non-www version of the site to the www

In wordpress site how to Redirect the non-www version of the site to the www version to remove duplicate content
2
votes
2answers
2k 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
0
votes
3answers
16k 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
1answer
414 views

wp_redirect to file:// location results in blank page/cannot be displayed page

I have a CPT that is justed used for linking to resources on a local drive. I have this code in single-resource.php: <?php global $post; the_post(); $location = get_post_meta($post->ID, ...
0
votes
1answer
455 views

Why does the first page of one category redirect to empty page 4?

When I load this URL on my WP e-ecommerce site, it 301 redirects to page 4 which does not exist, and appears as a page with empty contents: Go to this URL: ...
0
votes
2answers
2k views

BuddyPress redirecting to home page on login [closed]

I have two sites (towermix.com and beta.towermix.com) running BuddyPress and both are doing the same thing. When a site admin (or contributor or author) logs in using the WordPress login page, they ...
0
votes
1answer
838 views

Redirect plugin after form submit or show errors

I've been developing a wordpress plugin that has an admin section with a form to add and edit various things. Now after an admin submits the form I wanted to redirect if successful (to show updated ...
0
votes
2answers
866 views

Question about proper use of wp_redirect?

I'm attempting to create a Twitter style stream, so basically just index, a tag archive, and maybe a page or two while prohibiting access to everything else. For instance, they try to access a single ...
1
vote
1answer
3k 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
2k 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 ...
3
votes
2answers
2k 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 ...
0
votes
1answer
214 views

Cannot get redirect working

I can't get wp_redirect working correctly? I thought I'd figured this out (see wp_redirect not working when going to www version of site) but apparently not; no idea what changed between last week ...
4
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 ...
-2
votes
1answer
88 views

How is WordPress redirecting/rewriting my URL?

i'm running a wordpress free classified website and the address is http://www.gosell.co.uk what i need is if a user from london open this url then it should be concatenated with ...
2
votes
1answer
397 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( ...
0
votes
1answer
399 views

wp_redirect not working when going to www version of site

The following function works perfectly when logged-in visitors go to http://sitename.com, taking them to the site homepage. When logged-in visitors go to http://www.sitename.com, however, they're ...
0
votes
2answers
4k views

Checking if a user is logged in, if so redirect to a different page

I'm making a member-only site that requires users to be logged in to use the site. The homepage is publicly viewable. On the homepage, I'd like to put in a function to redirect users to a page inside ...
-1
votes
1answer
164 views

problem redirecting users to page on login

I'm trying to redirect certain users to a part of my site but I cannot seem to make it work... can you take a look at this and tell me what I'm doing wrong? if ( ! function_exists( ...
0
votes
1answer
396 views

Load template inside a parent template

Inside of my current theme directory, I created a folder called "mobile" which contains a separate set of template files, all optimized for mobile. Now, say I setup a function that detects a mobile ...
0
votes
1answer
202 views

Does WordPress send a 301 header message when you change permalink structures?

I have a super old blog that I upgraded from 2.0.7 to 3.1 by upgrading over multiple versions. One of my biggest concerns was losing all the link juice from my legacy URLs but they were clearly made ...
1
vote
1answer
889 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: ...
0
votes
1answer
205 views

Error messages when adding code to function.php or trying to delete inactive plugin files

Error message below: Warning: Cannot modify header information - headers already sent by (output started at /home/content/79/7603579/html/listings/wp-content/themes/OIB theme/functions.php:519) in ...
7
votes
1answer
3k 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 ...
0
votes
1answer
1k views

Redirecting to a post based on a GET parameter and a custom field

I'm trying to redirect to a specific post based on a GET parameter. The value of the GET parameter is the value of a specific custom field. For example: http://somedomain.com/wordpress/?fid=xyzzy ...
0
votes
2answers
323 views

Redirecting simple big problem

i'm a little worried here. I'm trying to redirect EVERYONE that access my site to a specific webpage, and nothing is working! Currently i'm trying this code: function redirect_this() { ...
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 ...
4
votes
2answers
2k 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?
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 ...
0
votes
1answer
313 views

Date based redirects of posts that no longer exist

I want a more elegant way to express the following redirect: RewriteCond %{REQUEST_URI} ^/blog/2008/(.*) [NC, OR] RewriteCond %{REQUEST_URI} ^/blog/2009/01/(.*) [NC, OR] RewriteCond %{REQUEST_URI} ...
3
votes
4answers
848 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? ...