Site AI Auditpor Internet Solutions

Meta Refresh and JavaScript Redirects: SEO Risks Explained

3 de noviembre de 20268 min de lecturaFundamentos de SEO
Meta Refresh and JavaScript Redirects: SEO Risks Explained

Short answer: A meta refresh is a tag in the page that sends the browser to another address, and a JavaScript redirect does the same with a script. Search engines can often follow both, but they are slower, less dependable and worse for visitors than a server-side 301 or 302 redirect. Use them only when you cannot change the server, and replace them with proper redirects when you can.

Three ways to redirect a visitor

A redirect sends a person or a crawler from one address to another. There are three common ways to do it.

The last two happen inside the page. The server has already said “here is a page”, so a crawler must read the page and interpret it before it learns that the content lives elsewhere.

What search engines do with them

Google has said that it can follow meta refresh and JavaScript redirects, but it prefers server-side redirects and describes the page-level methods as less reliable. For a meta refresh, Google reads the tag when it processes the page. For a JavaScript redirect, it has to render the page first, which happens in a second step that may come later, as covered in the guide to JavaScript SEO basics.

The consequences for you are practical:

None of this means that a page-level redirect will destroy your rankings, but it adds risk that a simple server rule avoids.

Problems for visitors

Redirects in the page are not only a search matter. Visitors notice them too.

When they are acceptable

Sometimes you have no choice. A hosted website builder may not give access to server settings. A page on a platform that you do not control may allow only a tag or a script. In such cases:

  1. Prefer a meta refresh with a delay of zero seconds over a long delay, because it is closer to a normal redirect.
  2. Add a visible link to the new address inside the old page, so that visitors and crawlers can follow it if the automatic redirect does not run.
  3. Set a canonical tag on the old page that points to the new address, as described in the article on canonical tags.
  4. Keep the page quick and the text short.
  5. Plan to replace it with a server redirect as soon as the platform allows.

JavaScript redirects are also used legitimately for tasks that depend on the visitor, such as sending people to a language version after login. Avoid using them for permanent address changes.

How to replace them with proper redirects

On most sites this is a quick job for someone with access to the server or the CMS.

Use 301 for permanent moves and 302 for temporary ones. Redirect each old address to the most relevant new page, not to the home page for everything, and avoid chains of several redirects in a row, as explained in the guide to redirect chains and loops.

How to find page-level redirects on your site

  1. View the source of suspicious pages and search for “refresh” in the head, and for “location” in scripts.
  2. Crawl your site with a tool that reports redirect types. Many crawlers list meta refresh separately from server status codes.
  3. Check Search Console for pages reported with redirects, as explained in the article on Page with redirect.
  4. Open old marketing addresses, printed addresses and old links from other sites, and see where they land and how.
  5. Ask your developer or agency whether any landing pages use scripts to forward visitors.

Remember that some malware injects sneaky redirects through scripts, which send visitors from search to another site. If a page redirects in a way that you did not create, treat it as a security problem and read the article on cloaking and sneaky redirects.

How to test a redirect after you change it

Never assume that a redirect works because the rule looks right. A short test routine catches most errors before visitors or search engines meet them.

  1. Test the exact old address. Type or paste it, with and without the trailing slash and with both the www and non-www forms. Each version should end on the same new page.
  2. Read the status code. In the network tab, the first response for the old address should be 301 or 302 with a location header. The final response should be 200.
  3. Count the steps. One redirect is ideal. If the visitor passes through three steps, merge them into a single rule.
  4. Check on a phone. Mobile networks and some in-app browsers behave differently from a desktop computer.
  5. Test with scripts off. If the new address only works because a script runs, a crawler that does not run scripts will not follow it. A server redirect works either way.
  6. Inspect in Search Console. Use the URL inspection tool on the old address to see what Google found, then request indexing of the new page if needed.
  7. Update the sitemap. It should list only the final addresses, never the ones that redirect.

Repeat the test after any change to the server, the CDN or a caching plugin. Redirect rules are among the first things to break when someone moves a site, changes the server software or restores an old backup, and the damage often goes unnoticed for weeks because the home page still looks fine.

Common mistakes

How Site AI Audit helps

Site AI Audit follows the links of your site and reports redirects and broken links among the SEO findings, together with titles, descriptions, headings, the sitemap, robots.txt and noindex settings. It can help you see which addresses redirect before you decide how to fix them. The first check is free, covers up to 50 pages and needs no sign-up. You can run a free check of your website or see the plans for weekly monitoring and alerts.

Related reading

The bottom line

Use server-side redirects whenever you can. Treat meta refresh and JavaScript redirects as temporary workarounds, make them instant, add a visible link and a canonical tag, and replace them as soon as you get access to the server.

FAQ

Does Google follow a meta refresh redirect?

Often yes, but server-side redirects are more reliable and are the recommended method. Use a meta refresh only when nothing else is possible.

Are JavaScript redirects bad for SEO?

They can work, but they depend on rendering and are slower to be recognised. Avoid them for permanent address changes.

What is better than a meta refresh?

A 301 redirect for permanent moves or a 302 for temporary ones, set on the server, in the CMS or at a CDN.

Can a meta refresh cause a loop?

Yes, if it points back to a page that redirects again. Test each redirect from start to finish after a change.

How can I tell which type of redirect a page uses?

Check the response status in the browser’s network tab. A 301 or 302 means a server redirect. A normal 200 response followed by a jump points to a tag or a script.

#Redirects#Site migration#Technical SEO
Analiza tu propia web — gratis.Qué corregir en tu web — y por dónde empezar.
Empieza gratis
Internet Solutions

Más de nuestro equipo

Creadas por Internet Solutions. Prueba nuestros otros productos: cada uno te ahorra tiempo de una forma distinta.

internet-solutions.net ↗