Recently, we were working on a project that involved adding search engine optimization to one of our clients’ web projects, by adding meta tags to each of the pages. The meta tags help give search engines and other sites the metadata that they need so they can better interact with your website.
For this project, we added the most common and important meta tags. It’s usually a good idea to add as many of these as you can to the pages of your websites. They are added in the format
<meta name="(tag name)" content="(tag content)">.
The meta “description” tag should contain a brief description of the web page. This tag’s content is the text you see below the title on Google search results. Meta description text should generally not be longer than 160 characters.
The meta “url” tag is for the canonical URL. Now, the canonical URL is not always the same as the URL you type into the search bar to get the page. Sometimes, multiple URLs can lead to the same page, such as www.example.com versus www.example.com/index.htm. This also might happen if you’re using redirects, URL slugs, or URL parameters. For this, you want to use the most standard URL for the page, the most common one, the one that’s the best reference to the page.
The meta “robots” tag gives instructions to bots and web crawlers that visit the page. Typically, this tag’s content is set to “index, follow”, which tells the search engines that they may view and index the page. But, if for some reason, you want a private page that’s not supposed to be seen in Google results, you can instead set the content to “none”, and the crawlers will ignore that page, eventually removing it from search engine results.
Facebook and twitter have their own special meta tags which you should probably also include to make users better able to link to the pages on social networks. Facebook uses a system of meta tags called open graph, or OG for short, and have full documentation on their website’s developers pages.
Some of their tags are duplicates of tags you already have elsewhere. The tags “og:url” and “twitter:url” should both refer to the same canonical url as “url” does. The tags “og:description” and “twitter:description” should also refer to the same meta description as the description tag. Also, “og:title”, and “twitter:title” should contain the page title, same as the <title> tag. However, others are unique.
Meta “og:site_name” is for the name of the website.
Meta “og:image” and “twitter:image” should contain a path to an image file that you want to use to represent the page when shared on Facebook or Twitter.
Finally, the meta tag “og:type” is for the type of the page. Facebook keeps a list of types you can use here.
Using meta tags really helps out with search engine optimization. Each of these tags helps tell Google and other search engines what your web page is about, so it helps you get a higher search ranking when people search for relevant topics. When building your website, I highly recommend including as many of these tags as you can. There are many more tags, but these are probably the most important.