What Is http-equiv? How to Use meta refresh and Key Cautions

Published:
Last Updated:
Category: Ad Operations
Authors: Shusaku Yosa

Published:
Last Updated:
Category: Ad Operations
Authors: Shusaku Yosa
When building a website, you may come across an attribute called "http-equiv" inside the HTML <head>. It looks cryptic at first glance, but it plays an important role in controlling fundamental site behavior such as redirects and character encoding. This article explains what http-equiv is from the basics, how to use meta refresh and other directives concretely, and the points you should keep in mind from an SEO and user-experience perspective.
http-equiv is one of the attributes you can specify on an HTML meta tag, and it stands for "HTTP equivalent." Originally, it is a mechanism for specifying, from the HTML side via a meta tag, information that a web server would normally send as an HTTP response header. Its defining feature is that even in environments where you cannot directly change server settings, you can issue specific instructions to the browser by writing them in the HTML file.
The basic syntax is as follows: you specify the type of directive in http-equiv and its value in content.
<meta http-equiv="directive type" content="value">
The most well-known use is meta refresh. After a specified number of seconds, it can reload the page or automatically move to a different URL. The following example navigates to a specified page after 5 seconds.
<meta http-equiv="refresh" content="5; url=https://example.com/">
The number in the content attribute is the wait time in seconds, and the destination is written after url=. If you omit the url part, it will auto-refresh the same page at a fixed interval.
In the past, http-equiv="content-type" was widely used to specify the character encoding. Its role is to tell the browser the encoding so as to prevent garbled text.
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
However, in HTML5 the simpler <meta charset="UTF-8"> is recommended, and today that is generally what you should use.
Using http-equiv="content-security-policy", you can restrict the sources from which scripts and images may be loaded, which helps reduce risks such as XSS (cross-site scripting). It is preferable to set this via an HTTP header, but it is used as an alternative when you cannot change server settings.
This was a directive once used to control the display mode of Internet Explorer. Since IE is now end-of-life, there is almost no need to use it on new sites.
Representative situations where meta refresh is used include notice pages that inform visitors of a page move (a screen that says "You will be automatically redirected in X seconds"), dashboards or message boards that want to reflect the latest information at fixed intervals, and guiding users from an old page to a new page after a campaign ends. Its appeal is the ease of implementing it with HTML alone, without touching server-side settings.
From an SEO perspective, when permanently moving a page you should use a server-side 301 redirect rather than meta refresh. A 301 redirect accurately tells search engines that "the page has permanently moved," making it easier to pass evaluation (such as link equity) to the destination. With meta refresh this transfer is uncertain, and Google basically recommends server-side redirects.
An implementation that immediately jumps to another page with zero wait time, like content="0; url=...", risks being regarded as a "cloaking"-like technique where the content shown to the user differs from the actual destination. Even when you have no choice but to use it, it is safer to avoid such instant redirects.
Auto-refresh and auto-redirect can hinder user actions, for example making it impossible to return to the previous page even when the user presses the browser's "back" button. If the page switches at an unexpected moment, it can also cause users to lose their place while reading. WCAG (the web accessibility guidelines) likewise require that auto-refresh or redirects that the user cannot control be avoided, or that the user be able to stop or extend them.
http-equiv is, after all, an alternative to HTTP headers. For character encoding, security policy, and redirects alike, if you are in an environment where you can configure them on the server side, it is preferable to do so. This is because directives on the HTML side are applied only after the browser parses the HTML, so their effect may be delayed compared to specifying them in headers.
http-equiv is a convenient attribute that lets you issue directives equivalent to HTTP response headers from an HTML meta tag, and it is used for things like auto-refresh and redirects via meta refresh, as well as character-encoding specification. However, in many situations more appropriate means are available, such as a 301 redirect for permanent page moves and meta charset for character-encoding specification. Understanding the impact on SEO and accessibility, it is recommended to use http-equiv only where necessary, as a supplementary means for cases where you cannot set things via HTTP headers.

Explains the differences between GDN (Google Display Network) and LINE Yahoo Ads Display Ads (formerly YDA) from the per...

Google Optimize was discontinued on September 30, 2023. This article explains the reasons, the alternative tools Google ...

A beginner-friendly explanation of what web advertising is. Covers the meaning and features of internet and online adver...