Early Access
refresh
Used to redirect the user to a new URL after a certain number of seconds, or to refresh the current page. While it can be useful for redirecting users or refreshing content, its usage is generally discouraged in favor of server-side redirects or JavaScript for a better user experience and performance.
Parameters
<meta http-equiv="refresh" content="seconds" />
<meta http-equiv="refresh" content="URL" />
Code Examples
<meta http-equiv="refresh" content="5;url=http://example.com" />
<meta http-equiv="refresh" content="0;url=http://example.com" />
<meta http-equiv="refresh" content="300" />
<meta http-equiv="refresh" content="3" />
Recommendations
- Prefer Server-Side or JavaScript RedirectsInstead of using meta refresh for redirection, consider server-side HTTP redirects (status code 301 or 302) or JavaScript-based redirection for better SEO and user experience.
- Use With Caution for RefreshIf you must use meta refresh for content refresh, keep the interval long enough to not impair the user experience, especially on pages requiring reading or interaction.
Related Documentation
Related Meta Tags
content-type
Defines the MIME type and character encoding for the HTML document. It sets the character set used for the HTML document, which is crucial for correctly displaying text.
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
Content-Security-Policy
Defines which dynamic resources are allowed to load, thus helping to prevent cross-site scripting attacks, data injection, and other malicious attempts to exploit web page vulnerabilities.
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self' https://apis.google.com;">
X-UA-Compatible
Advises the web browser to display the webpage in compatibility view or a specific version of Internet Explorer. Primarily used to instruct Internet Explorer to use its Edge rendering engine.
<meta http-equiv="X-UA-Compatible" content="IE=edge">
default-style
Specifies the name of the preferred stylesheet to use on a web page. This allows users or user agents to choose the default stylesheet amongst many provided.
<meta http-equiv="default-style" content="Main Style">
refresh
Used to redirect the user to a new URL after a certain number of seconds, or to refresh the current page. While it can be useful for redirecting users or refreshing content, its usage is generally discouraged in favor of server-side redirects or JavaScript for a better user experience and performance.
<meta http-equiv="refresh" content="5;url=http://example.com">
Community