I have homepage which needs to redirect to another page. For this to accomplish, I used the meta fresh tag

<meta http-equiiv=refresh content="6; url=/home/">

And, it works perfectly. Later I found on Internet that this meta fresh code tag has been deprecated and is not at all SEO friendly.

Then I used one js code

<script type="text/javascript">
setTimeout("window.location='url'",5000);
</script>

and it’s also working.. now, my concern is – which one still better (most SEO friendly or is there any other hack in redirecting a simple page to another WP normal page?

Thanks in advance.

4 Answers
4

Though wp_redirect() doesn’t allow a delay, PHP’s header() ( which is what wp_redirect uses ) does via refresh.

This may work for you.

<?php 
  header( "refresh:5;url=wherever.php" ); 
  echo 'You\'ll be redirected in about 5 secs. If not, click <a href="https://wordpress.stackexchange.com/questions/149730/wherever.php">here</a>.';
?>

Tags:

Leave a Reply

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