0

I currently have a description at the top of my category pages (woocommerce) of the form

<div><input id="post-1" class="read-more-state" type="checkbox" />
    <div class="read-more-wrap">
        <h2>Title-2</h2>
        <p>paragraph - 1.</p>
        <div class="read-more-target">
            <div>Descriptiob Part 1.</div>
            <div>Description part 2.</div>
        </div>
    </div>
    <label class="read-more-trigger" for="post-1"></label>
</div>

You will notice that the description part 1 and 2 are wrapped in <div> rather than <p>. I have tried to wrap in <p> but is then stops the show more functionality working so I have been foced to use div elements.

My question is, as far as search engines are concerned, does it make any difference whether the text be wrapped in div or p? Or does the search engine interpret the data in the same way?

So whether wrapped in div or p, would search engines see this as a description and be able to associate it with the relevant search? Or would it only be the first part - <h2>…</h2>…<p></p> that gets used?

  • Should not make a difference. However, since both the div tag and p tag imply a break, you can just style a p tag to do what you want. Cheers!! – closetnoc Jun 25 '18 at 20:00
  • 1
    You can fiddle with your code all day long... it'll never make any noticeable changes. Google and Bing do not CARE what your code looks like... they care about the 'RENDER', how you get there is down to you. A raw document text file can rank just as well as an HTML page. Learn the basics and focus more on your content. – Simon Hayter Jun 25 '18 at 22:58
  • The only recommendation is that you could shorten your code but again, this won't improve your rankings. I'd remove the .class and #id and just use a container class and then you style with the type. For example: .box input .box label .box > div /* first div in the box */ .box > div > div /* first divs within the div within the box /* .box h2 .box p etc – Simon Hayter Jun 25 '18 at 23:05
  • 1
  • @SimonHayter Just to check my understanding... Does that mean that whether the text is wrapped in a div or p search engines will interpret the information in the same way? – SupGen Jun 26 '18 at 10:37
1

Div is non-semantic element, so it tells nothing about its content. If it's paragraph of text then you should use p tag, so I would recommend to replace div to p in order to be semantically correct and help search engines better understand your content. The same way it goes for headings: if there is heading then you should use proper tag (h1 to h6 tag).

  • I like this answer. I always advise tradition and using the proper html tags in a Dom. – closetnoc Jun 26 '18 at 16:16

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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