On this page
What this issue is
Every response from a web server carries a Content-Type header. It tells the browser what kind of file is coming, such as text/html for a web page or application/json for data. The type is called a MIME type.
This issue happens when a real HTML page is sent as text/plain. The HTML is fine, but the label is wrong. Browsers follow the label, so they may show the page as plain text with all the tags visible.
Common causes are a missing MIME mapping for a file extension, a script or PHP file that sets the header by mistake, a proxy or CDN rule that rewrites it, or a page saved with an extension the server does not map to HTML.
Why it costs you leads or sales
Visitors who land on the page see code instead of your offer. They leave. Forms, buttons and checkout links do not work because nothing is rendered.
For search, the wrong type is a risk. Google generally tries to work out content from the body, but you should not rely on that. A page labelled as plain text may be treated as a text file, not a page, so it may rank poorly, lose its snippet, or be skipped by AI assistants that fetch your page. Impact is medium because it often hits only some URLs, but those can be money pages.
- Visitor or crawler requests pageRequest arrives and returns 200
- Server sends Content-Type: text/plainWrong label on an HTML body
- Page shows raw codeNo layout, no buttons
- Lead form or checkoutNever reached
The page content is fine, but the label makes browsers and crawlers treat it as a text file.
Broken
- Header: Content-Type: text/plain
- Browser shows <html> and <div> tags as text
- Crawlers may treat the URL as a text file
Fixed
- Header: Content-Type: text/html; charset=UTF-8
- Browser renders the page
- Crawlers read it as a normal web page
How to check if your site has it
The fastest check is to request only the headers of the page. Look for the content-type line.
curl -sI https://www.example.com/your-page/ | grep -i content-type
# Good: content-type: text/html; charset=UTF-8
# Bad: content-type: text/plainOpen the page in a browser
If you see tags like <div> and <script> as text, the type is almost certainly wrong.
Use browser DevTools
Open the Network tab, reload, click the first request (the document) and read Content-Type under Response Headers.
Use Google Search Console
Run URL Inspection on the page, then View crawled page and open the HTTP response. Check the content-type line.
Test several URLs
Check the home page, a landing page, a product page and a thank-you page. Often only one template or folder is affected.
How to fix it
First find where the header is set. Test the origin server directly if you can, then test through your CDN or proxy. If the origin is right and the public URL is wrong, the CDN or proxy is the cause.
Look for code that sets the header
Search your theme and plugins for
header('Content-Typeorsend_headers. Remove or correct any rule that sends text/plain for normal pages.Check caching and security plugins
Disable them one at a time, clear the cache and test again with curl -I.
Check the server
If a .html file or extensionless URL is affected, fix the Apache or nginx rule shown in the Custom code tab.
Check custom templates
In Online Store > Themes > Edit code, look for templates with a .json or .liquid file that sets a different layout or content type, for example a template made for a text output.
Check apps and proxies
If the URL is an app proxy page, the app controls the header. Contact the app developer.
Contact Shopify support
Standard theme pages are served as HTML by Shopify. If a normal page is wrong, send support the curl output.
Check the page type
Webflow serves pages as HTML. If you use a reverse proxy or a custom domain setup in front of Webflow, test the Webflow staging URL (.webflow.io) to see whether the proxy changes the header.
Fix the proxy rule
Remove any rule that overrides the content-type response header.
Rule out GTM
GTM does not set the page Content-Type. If your page looks wrong, the cause is on the server, CDN or CMS, not in your container.
Apache: map the extension
Add the lines shown below to .htaccess or the server config, then reload.
nginx: include mime.types
Make sure the http block has include mime.types; and default_type text/html or application/octet-stream is not hiding a missing mapping.
App code: set the header
In PHP use header('Content-Type: text/html; charset=UTF-8'); before any output. In Node/Express use res.type('html').
CDN or proxy
Look for response header rules (Cloudflare Transform Rules, CloudFront response header policies, Nginx proxy_hide_header) that overwrite Content-Type.
AddType text/html .html .htm
AddDefaultCharset UTF-8http {
include mime.types;
default_type application/octet-stream;
}How to confirm it's fixed
Clear caches
Purge your CDN, server cache and any page cache plugin. Old responses may keep the wrong header.
Re-run curl
Run curl -sI on each affected URL and confirm text/html.
Load the page in a private window
Check it renders with layout, images and working buttons.
Request indexing
In Search Console, run URL Inspection, then Test live URL and Request indexing for key pages.
How to prevent it happening again
- Keep the MIME types file or include in your server config; do not delete it during upgrades.
- Test headers on staging after any server, CDN or proxy change.
- Review response header rules in your CDN after every edit.
- Add a header check on key URLs to your release checklist.
- Avoid setting Content-Type in code unless the response really is not HTML.
How FunnelGuard handles this
FunnelGuard does not check Content-Type headers today. It is a possible future check.
What FunnelGuard does do is run your real customer journeys with a robot visitor, such as lead forms, checkouts and booking or chat buttons, and check each step. If a page shows raw code, a step that needs a button or form would likely fail to complete, so a broken journey could show up that way. That would not tell you the header was the cause.
To watch for this issue yourself, run curl -sI on your key URLs after each deploy, or use a crawler such as Screaming Frog, which lists the Content-Type of each URL. Search Console URL Inspection also shows the response header for a page.
Questions people ask
Why is my website showing HTML code instead of the page?
The server is probably sending the page with Content-Type text/plain, so the browser shows it as text. It can also happen if the file is saved with the wrong extension. Check the header with curl -I and fix the server or CMS setting.
How do I check the Content-Type header of a page?
Run curl -sI https://yoursite.com/page/ and read the content-type line. You can also open browser DevTools, go to the Network tab, click the page request and read Response Headers. A normal page should show text/html.
Will Google index a page served as text/plain?
It may not be treated as a normal web page, and results can be unreliable. Google can sometimes work out the content, but you should not depend on it. Fix the header so the page is clearly HTML.
What should the Content-Type be for an HTML page?
Use text/html; charset=UTF-8. The first part says it is HTML and the charset makes sure special characters display correctly.
How do I fix Content-Type text/plain on nginx?
Make sure the http block includes include mime.types; and that no location block sets default_type or add_header Content-Type to text/plain. Then reload nginx and test again with curl -I.
Why does only one page have the wrong Content-Type?
A rule, plugin, template or script may apply only to that URL, folder or file type. Compare the affected URL with a working one and check any redirect, rewrite or CDN rule that matches it.
Can a CDN cause the wrong Content-Type?
Yes. A response header rule or cached response can overwrite the header. Compare the origin response with the public one, fix the rule and purge the cache.
Does FunnelGuard check for the wrong Content-Type header?
No, not yet. It is a possible future check. For now, use curl -I, Search Console URL Inspection or a site crawler to check your key pages.
Related issues
- SEO-066Money page returns 4xx or 5xxFix guide
- SEO-068Soft 404: error or empty page returned with 200Fix guide
- SEO-079Pages served with gzip/brotli errors or truncated HTMLFix guide
- SEO-080Timeout before HTML is deliveredFix guide
- SEO-067Site down or maintenance mode for crawlers and visitorsFix guide
- SEO-069Out-of-stock or expired product pages return 404 instead of staying usefulFix guide