Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Should meta tags be HTML-encoded?

Tags:

I generally HTML-encode any user generated content that I render on my website, so ampersands become & and so on. I was wondering if this should be done (from a standards point of view) to any dynamically generated meta tag throughout a site?

like image 994
marcusstarnes Avatar asked Jul 22 '10 17:07

marcusstarnes


People also ask

Does metadata include HTML coding?

Metadata is data that describes data, and HTML has an "official" way of adding metadata to a document — the <meta> element.

How are meta tags coded?

<meta> tags always go inside the <head> element, and are typically used to specify character set, page description, keywords, author of the document, and viewport settings.

What should your meta tags be?

A meta description should include a compelling summary of the page someone is about to click on. It should clearly tell them what they'll gain by clicking through. Meta descriptions should include a target keyword to help search engines index and rank the page.

Does UTF-8 need meta charset?

It doesn't matter which you use, but it's easier to type the first one. It also doesn't matter whether you type UTF-8 or utf-8 . You should always use the UTF-8 character encoding. (Remember that this means you also need to save your content as UTF-8.)


1 Answers

Absolutely. All content within the HTML document must be encoded this way.

like image 195
Sean Reilly Avatar answered Sep 21 '22 11:09

Sean Reilly