Build a non‑HTML assets SEO plan: PDFs/video/images, x‑robots‑tag, canonical surrogates,…
- User
Build a non‑HTML assets SEO plan: PDFs/video/images, x‑robots‑tag, canonical surrogates, and sitemaps.
Assistant
Build a non‑HTML assets SEO plan: PDFs/video/images, x‑robots‑tag, canonical surrogates, and sitemaps.
The user wants an SEO plan specifically for non-HTML assets (PDFs, videos, images). The plan needs to cover specific technical areas:
X-Robots-Tag).Target Audience: SEO professionals, web developers, or site owners looking to improve their visibility for non-text content. Tone: Professional, technical, actionable, and structured.
Key Components to Cover:
PDFs:
X-Robots-Tag vs. Meta tags (not possible in PDF usually) vs. Robots.txt (bad practice for blocking indexation).Images:
Videos:
X-Robots-Tag (The Server-Side Control):
noindex, noimageindex, etc.).Canonical Surrogates:
Link: <...>; rel="canonical"). This is crucial for PDFs and API responses.Sitemaps:
Drafting the Structure:
Refining the Content:
alt text and Core Web Vitals (CLS/LCP).noimageindex on specific PDFs if you don't want the thumbnails in image search.Self-Correction/Edge Cases:
rel="canonical" in HTTP headers for PDFs? Yes.X-Robots-Tag: noindex instead. I should mention this distinction clearly.Final Polish: Make it a checklist format or a strategic roadmap. Use code blocks for technical examples.
Let's assemble the plan.
Check against user prompt: "PDFs/video/images" (Check), "x-robots-tag" (Check), "canonical surrogates" (Check), "sitemaps" (Check).
The plan looks solid. I will proceed to generate the response based on this structure. This plan outlines the technical strategy for optimizing non-HTML resources (PDFs, images, and videos). Since Google cannot "browse" these assets in the traditional sense, we must rely on server-side directives, HTTP headers, and structured surrogate controls to manage their indexation and ranking.
Before technical implementation, we must determine the intent for each asset type.
X-Robots-Tag: noindex (prevents ranking, but allows links if tracked).alt text on the embedding page and structured data to provide context crawlers lack when viewing raw pixels.VideoObject schema; YouTube embeds rely on YouTube’s metadata, but you should supplement with on-page schema.Unlike HTML <meta> tags, non-HTML files rely on HTTP headers. This requires access to .htaccess (Apache), nginx.conf (Nginx), or serverless function headers.
Link: <https://www.example.com/page.html>; rel="canonical"/downloads/ or /private/).
X-Robots-Tag: noindex, nofollownoimageindex.Apache (.htaccess)
<FilesMatch "\.(pdf)$">
# Canonicalize all PDFs in the "resources" folder to their HTML counterpart
# Note: This usually requires a map file or PHP logic for dynamic URLs.
# For site-wide logic, we typically just set noindex or generic directives.
Header set X-Robots-Tag "noindex, nofollow"
</FilesMatch>
# Specific canonical header for a single important PDF
<Files "whitepaper-2024.pdf">
Header set Link '<https://www.example.com/blog/whitepaper-2024>; rel="canonical"'
</Files>
Nginx (nginx.conf)
location ~* \.pdf$ {
# Canonicalize PDFs to the HTML version if possible
add_header Link "<https://www.example.com/resources/$1>; rel=\"canonical\"";
# OR block indexing of PDFs to force users to HTML pages
add_header X-Robots-Tag "noindex, nofollow";
}
location ~* /private/.*\.(jpg|png|gif)$ {
add_header X-Robots-Tag "noindex";
}
Sitemaps help search engines discover assets that might be buried deep in site architecture or loaded via JavaScript.
Do not create a separate sitemap for images. Extend your standard XML sitemap using the <image:image> tag nested under the URL where the image appears.
<url>
<loc>https://www.example.com/product/t-shirt</loc>
<image:image>
<image:loc>https://www.example.com/images/t-shirt-red.jpg</image:loc>
<image:caption>Red Cotton T-Shirt</image:caption>
<image:title>Red T-Shirt Product Photo</image:title>
<image:license>https://www.example.com/license</image:license>
</image:image>
</url>
For self-hosted videos or videos you want to appear with a rich snippet in Google Video Search.
<url>
<loc>https://www.example.com/video/landing-page.html</loc>
<video:video>
<video:thumbnail_loc>https://www.example.com/thumbs/123.jpg</video:thumbnail_loc>
<video:title>How to Grill a Steak</video:title>
<video:description>A 5-minute guide...</video:description>
<video:content_loc>https://www.example.com/video123.mp4</video:content_loc>
<video:player_loc>https://www.example.com/videoplayer.swf?video=123</video:player_loc>
<video:duration>600</video:duration>
</video:video>
</url>
You can list PDFs directly in a sitemap. However, it is better to list the HTML page that links to the PDF. If you must list the PDF directly:
indexable (no X-Robots-Tag: noindex).Since Google cannot "read" video or image files natively with 100% accuracy, we use JSON-LD on the hosting page to describe the asset.
Place this on the page where the video is embedded.
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "VideoObject",
"name": "How to Optimize PDFs",
"description": "A complete guide to technical SEO for documents.",
"thumbnailUrl": [
"https://example.com/photos/1x1/photo.jpg"
],
"uploadDate": "2023-10-01T08:00:00+08:00",
"contentUrl": "https://www.example.com/video/seo.mp4",
"embedUrl": "https://www.example.com/embed/seo"
}
</script>
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "ImageObject",
"contentUrl": "https://example.com/photos/1x1/photo.jpg",
"name": "Workflow Diagram",
"author": "Jane Doe"
}
</script>
| Asset | Optimization Action | Technical Requirement |
|---|---|---|
| PDFs | Text Recognition | Ensure PDFs are not flat scans; they must contain selectable text (OCR). |
| PDFs | File Size | Compress below 2MB-5MB. Large PDFs are often abandoned by crawlers. |
| PDFs | Properties | Edit "Document Properties" (Title, Author) in Acrobat/Word before exporting. |
| Images | Next-Gen Formats | Serve WebP or AVIF with <picture> tag fallbacks. |
| Images | Responsive | Use srcset to serve different sizes based on device width. |
| Video | Thumbnails | Provide a high-res thumbnail (JPG/PNG) via Sitemap or Schema. |
| Video | Transcripts | Place the full transcript on the page below the video for content relevance. |
.htaccess or nginx.conf to apply X-Robots-Tag and Link: rel="canonical" headers to PDFs.VideoObject and ImageObject on all landing pages.X-Robots-Tag and Canonical header are being read correctly.