CLENT CRUMLEY
  • Design
  • Development
  • Strategy
  • Contact
BarkBox.com

Home // Snippets // Temporary Redirect for non-admin WordPress Users

  • May 21st
  • 2015

Temporary Redirect for non-admin WordPress Users

Recently, a client needed to have a page available for editing but blocked from public view during development. We still needed to keep the page live for our purposes, as well as try to prevent any loss to our SEO and position in search results. A 307 temporary redirect is a perfect server-side solution to this issue, and WordPress makes it a breeze to implement.

Typically we would use a 301 redirect, but that is a rule that tells search engines that the page is ‘permanently moved’- which would cause problems for us when we re-enabled the page at the proper url. We decided the best solution was to create a temporary ‘coming soon’ page, and direct traffic there until ready for launch

Add this snippet to functions.php in your Custom WordPress Theme, and voila!
(Change URL’s to match your needs of course)


Sources:
  • W3TC HTTP Redirects
  • WordPress Codex – wp_redirect();

Posted in Wordpress by clent

Posted in Snippets by clent

~ ★ ~

Ready to get started?

I'm currently creating opportunity in Central Texas & would love the chance to be a part of your next web endeavor.

Fill out a short questionnaire and let's make some magic happen.

Start Project »
  • Design
  • Development
  • Strategy
  • Contact