Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google + Meta Description + Line break = Possible?

Is it possible to include line breaks in the description of a page shown in Google search results?

like image 857
iceteea Avatar asked May 30 '11 19:05

iceteea


2 Answers

No, it's impossible.

This shouldn't necessarily be obvious; literal newlines in HTML attributes are valid and meaningful (see https://stackoverflow.com/a/983942/1709587), and the HTML spec has nothing special to say forbidding them in <meta name="description" ... elements (see https://html.spec.whatwg.org/#meta-description), and Google even shows an example at https://support.google.com/webmasters/answer/35624?hl=en of this <meta> description including literal newlines:

<meta name="Description" content="Written by A.N. Author, 
Illustrated by V. Gogh, Price: $17.99, 
Length: 784 pages">

However, despite this, Google does not respect such newlines; any run of whitespace gets treated as a single space when showing the description in Google Search results. I did a quick experiment with a domain I control and a couple of other applications that respect <meta name="description" ...> elements - namely, Slack and Facebook - and found that they also behave in the same way, converting newlines I put into the description to spaces. At a glance, it appears to me that this is the unwritten standard.

like image 189
Mark Amery Avatar answered Sep 28 '22 16:09

Mark Amery


No. You can't use html; and HTML ignores whitespace (when it's not used inside a text tag) so it doesn't matter if there's a space (\n\r,etc) or not; google parser will just grab the string, strip any bad code and place the text alone.

Take into consideration that Google will grab 150 characters from the description meta tag. You can test it here: http://www.javascriptkit.com/script/script2/charcount.shtml

like image 33
MarioRicalde Avatar answered Sep 28 '22 17:09

MarioRicalde