How metadata shapes search results
Search engines and social networks read a set of tags in the head of every web page to decide how to present it. The title element is the most important: it usually becomes the clickable headline in search results and the label of the browser tab. Keep titles unique for every page, put the most important words first, and aim for roughly 50 to 60 characters, because longer titles are cut off based on pixel width.
The meta description is a short summary of the page. It does not directly influence ranking, but search engines often show it as the snippet under the title, so a clear, accurate description of about 150 to 160 characters can improve the share of people who click. Search engines may rewrite the snippet when they find a better match for a specific query.
Canonical URLs and indexing controls
The same content is often reachable at several URLs: with and without www, with tracking parameters, or through different category paths. A link rel="canonical" tag tells search engines which URL is the preferred version, which consolidates ranking signals and avoids duplicate-content problems.
The robots meta tag controls indexing for a single page. noindex keeps the page out of search results and nofollow asks crawlers not to follow its links. The robots.txt file at the root of a site works differently: it tells crawlers which paths they may fetch, but it does not remove pages from the index. A page blocked by robots.txt can still appear in results if other sites link to it, and a noindex tag on a blocked page will never be seen. Use robots.txt to manage crawling and noindex to manage indexing.
An XML sitemap lists the URLs you want discovered, along with optional last-modified dates. Reference it in robots.txt and submit it in search engine webmaster tools.
Social previews with Open Graph and Twitter Cards
When someone shares a link in a chat app or social network, the preview card is built from Open Graph tags: og:title, og:description, og:image, og:url, and og:type. X (formerly Twitter) reads its own twitter:card tags and falls back to Open Graph when they are missing.
The image matters most. A size of 1200 by 630 pixels works well across most platforms. Use an absolute URL, keep important text away from the edges because some platforms crop the image, and remember that many platforms cache previews, so changes may take time to appear after you update the tags.
Structured data and status codes
Structured data written in JSON-LD using the Schema.org vocabulary describes what a page is about in a machine-readable way, such as an organization, an article, a product, or a breadcrumb trail. Search engines can use it to display rich results. Structured data must match the visible content of the page; marking up information users cannot see violates search engine guidelines.
HTTP status codes also send SEO signals. A 301 redirect indicates a permanent move and passes signals to the new URL, while a 302 is temporary. Pages that no longer exist should return a real 404 or 410 status. Returning a 200 with an error message, known as a soft 404, wastes crawl budget and can keep broken pages in search results.