Skip to content

How to Check HTTP Response Headers for SEO

Last Updated: August 21, 2026

Why HTTP Headers Matter More Than You Think

Every time a browser or search engine crawler requests a page from your server, the server responds with two parts: headers and body. The headers are key-value pairs that arrive before the actual HTML content. They control caching behavior, security policies, content encoding, redirect logic, and how search engines should process the resource. Most site owners never look at these headers, yet misconfigurations silently damage crawl efficiency and indexing.

Googlebot downloads your page headers before parsing any HTML. A single incorrect header can prevent indexing, waste crawl budget, or serve stale content to crawlers. Understanding what each header does and how to verify it gives you direct control over how Google processes your site.

Checking Headers with curl

Open your terminal and use curl to inspect any page's response headers. The -I flag fetches only the headers without downloading the full HTML, giving you instant access to the server response:

curl -I https://example.com/blog/post-title
# Returns: HTTP/2 200, Content-Type, Cache-Control, X-Robots-Tag, etc.

curl -I -L https://example.com/old-page
# Follows redirects and shows each hop in the chain

The -L flag follows redirects, revealing the entire redirect path. A chain of more than three 301 hops wastes crawl budget and adds latency. If your /old-page redirects to /new-page which redirects to /latest-page, consolidate those into a single direct redirect from /old-page to /latest-page. Each hop adds a full server round-trip, which compounds on slow mobile connections.

For a quick audit of multiple pages, loop through your key URLs and check status codes:

for url in https://example.com/ https://example.com/about https://example.com/contact; do
  status=$(curl -s -o /dev/null -w "%{http_code}" "$url")
  echo "$url -> $status"
done

This reveals pages returning 200 when they should 404, or 302 redirects that should be 301. Our HTTP headers checker automates this across your entire site and flags every header-related SEO issue in a single report.

The Headers That Control Search Engine Behavior

X-Robots-Tag provides the same directives as the meta robots tag but through HTTP headers. This is essential for non-HTML resources where you cannot add a meta tag. Set X-Robots-Tag: noindex to prevent Google from indexing a PDF, image, or video file. Set X-Robots-Tag: nofollow to tell crawlers not to follow links on that resource. Use this header on internal search result pages, filtered category pages, or any resource that should be accessible to users but excluded from the search index.

Content-Type tells the browser and crawler what kind of content it is receiving. For HTML pages, the value must be text/html; charset=UTF-8. Missing the charset declaration causes encoding issues that produce garbled text in search result snippets. For JavaScript files, application/javascript is correct. For CSS, text/css. Incorrect Content-Type headers can cause browsers to misinterpret content, breaking rendering entirely.

Status codes are the most fundamental SEO signal in your headers. A 200 OK means the page loaded successfully and should be indexed. A 301 Moved Permanently passes approximately 90-99% of link equity to the new URL. A 302 Found indicates a temporary redirect and passes no link equity. A 404 Not Found tells Google the page is gone. A 410 Gone is stronger than 404, telling Google the page was permanently removed and will never return. Choosing the wrong status code is one of the most common technical SEO mistakes.

Cache Headers and Crawl Budget

The Cache-Control header dictates how long browsers and crawlers keep a cached copy. For HTML pages that change frequently, use max-age=3600 (one hour) or no-cache, which forces revalidation on every request. For static assets like images, CSS, and JavaScript with content-hashed filenames, set max-age=31536000 (one year) with the immutable directive.

The ETag header provides a validation token. When Googlebot revisits a page, it sends the ETag value back in an If-None-Match header. If the page has not changed, your server responds with 304 Not Modified and sends zero body content. This saves bandwidth and allows Googlebot to move on to the next page in its crawl queue faster. Without ETag support, Googlebot downloads the full page content every time, even when nothing has changed.

Configure these headers differently for each content type on your site. Our cache header checker validates your configuration and catches common mistakes like caching authenticated pages, setting overly long cache durations on dynamic content, or missing cache headers on static resources that should be cached for maximum performance.

Security Headers That Build User Trust

Security headers are not direct ranking factors, but they protect your users and prevent attacks that could take your site offline. The Strict-Transport-Security (HSTS) header forces browsers to use HTTPS for all future requests to your domain. The X-Content-Type-Options: nosniff header prevents browsers from MIME-sniffing responses, which can be exploited for cross-site scripting attacks.

The Content-Security-Policy (CSP) header controls which resources browsers are allowed to load. A misconfigured CSP can block your own CSS, JavaScript, or images from loading, completely breaking your page. Start with report-only mode to identify issues without breaking functionality:

Content-Security-Policy-Report-Only: default-src 'self'; script-src 'self' https://analytics.example.com

Our security headers checker evaluates your site against OWASP recommendations and identifies missing or misconfigured security headers that leave your users vulnerable.

Common Header Mistakes That Hurt SEO

Serving a 200 status code for pages that should return 404 is extremely common. If a deleted blog post returns 200 with "Sorry, this page was not found" displayed in the HTML, Google indexes it as a real page. The server should return a proper 404 or 410 status code so crawlers remove the URL from the index.

Using 302 redirects where 301s should be used dilutes link equity. A site migration that implements 302 temporary redirects instead of 301 permanent redirects causes Google to treat every redirected URL as a temporary state, passing little to no authority to the new URLs. Check your redirect status codes after any site migration or URL restructuring.

Serving uncompressed responses wastes bandwidth. If your server does not enable gzip or Brotli compression for HTML, CSS, and JavaScript, every page transfer is 60-80% larger than necessary. Use curl to verify compression is active:

curl -s -H "Accept-Encoding: gzip" -I https://example.com/page | grep -i content-encoding
# Should return: content-encoding: gzip

Missing Content-Type charset declarations cause encoding issues that display garbled characters in search result snippets. Always include charset=UTF-8 in your Content-Type header for HTML pages. Our HTTP headers checker detects all these issues across your site and provides specific fix instructions for each one.