robots.txt gives crawlers instructions about crawling paths on a site. It is not a reliable way to keep private information secret.
An XML sitemap lists URLs that a site owner wants search engines to discover. Neither a sitemap nor robots.txt guarantees indexing.
<!-- Optional sitemap reference in robots.txt is plain text, not HTML -->
Sitemap: https://example.com/sitemap.xml8. Images and SEO
<img
src="/images/html-form-example.webp"
alt="HTML contact form with name, email and message fields"
width="800"
height="450">Use accurate alternative text for meaningful images. Use empty alt text for purely decorative images. Descriptive filenames can help people and tools understand an asset, but filenames alone do not guarantee ranking benefits.
9. Structured Data
Structured data can describe information such as articles, products and organizations in a machine-readable format. It must accurately represent visible or otherwise eligible page content and follow the relevant search engine guidelines. Adding structured data does not guarantee a rich result.
Common Mistakes
- Stuffing keywords into titles, headings and paragraphs.
- Copying the same canonical URL onto unrelated pages.
- Blocking a page in robots.txt while expecting a crawler to read its noindex tag.
- Assuming a sitemap guarantees indexing.
- Using hidden or misleading structured data.
Practice Exercises
- Write a unique title and description for a Laravel tutorial page.
- Create a meaningful heading hierarchy for a blog post.
- Add a canonical link using a sample absolute URL.
- Explain the difference between robots.txt and a robots meta directive.
Revision Quiz
- What does a canonical link identify?
- Does a canonical tag guarantee which URL a search engine will index?
- What does noindex request?
- Is robots.txt a security mechanism for private data?
- Does a sitemap guarantee indexing?
- Should keywords be repeated unnaturally to improve SEO?
Answer Key and Explanations
- The preferred URL — It signals the canonical version of similar or duplicate content.
- No. Search engines consider other signals as well.
- Do not include the page in the search index — It is a directive for compliant search engines.
- No. Sensitive content needs proper authentication and access controls.
- No. A sitemap helps discovery but does not guarantee indexing.
- No. Write useful, natural content for readers.