Some sections of my website involve displaying a list of photo thumbnails. The source code to that is similar to the following when condensed:

<div> <a href="1">1</a> <a href="2">2</a> <a href="2">3</a> </div>

I also use stylesheets to format the anchor text so they are boxes with actual pictures in them that people can click on. At this moment, I think google is happy.

What I want to do is convert the above code to this:

<div><a href="1">1</a><a href="2">2</a><a href="2">3</a></div>

My question then is, if I convert my code and remove the spaces between each anchor tag, would googlebot be confused and believe the text is actually 123 all together when I'm trying to tell it I want the three links together with some spacing via CSS?

I want to shed off some more bytes off my code but at the same time, not confused search engines.

  • You should not worry. Removing these extra spaces will do little except for spacing between elements which you can control using CSS.
    – closetnoc
    Nov 26, 2015 at 2:17

2 Answers 2


I do not know a great deal about Search Engine Optimization, but I do know enough about HTML parsing to know that whitespace is mostly ignored to the parser. HTML parsers and SEO parsers should work in a similar manner. As a rule of thumb I would expect this to be true: If a website's source code is changed and it renders the same, it should rank the same.


You will not have any problems with this at all and Google recommends you remove such space when possible.

Minification refers to the process of removing unnecessary or redundant data without affecting how the resource is processed by the browser - e.g. code comments and formatting, removing unused code, using shorter variable and function names, and so on.

  • I did read about that rule on google, but their page-speed insights tool never complained about it when I have spacing between elements the way I described in my question. I wonder if their tool is buggy Nov 26, 2015 at 16:50
  • @Mike The short space they mention between links in page-speed insights tool is about design & UX. It simply means that users browsing your website on smaller screen will have problem clicking on these links if they are closer. What you need to do is increase left-right margin on these links in CSS.
    – Robert hue
    Nov 27, 2015 at 7:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.