DISCLAIMER: this post is older than one year and may not be up to date with latest WordPress version.

Do you know that WordPress have a built-in function to redirect users to a specific url? It is called wp_redirect(). Many users don’t know it, but you can also create 301 redirections with that useful function.

To create a 301 redirection within WordPress, you just have to add the 301 argument to the function:

<?php wp_redirect('https://www.wprecipes.com', 301); ?>

The above code will redirect anyone on my blog. Don’t hesitate to use it 😀

Leave a Comment

Your email address will not be published. Required fields are marked *