2

Is it OK if I use display:none to hide the theme's default h1 tag on single post and replace with another one I manually place?

This is done for styling purpose.

Generally, does display:none affect SEO?

Thank you.

Rob999
  • 31
  • 1
  • 1
    Search engines rely on the HTML structure, so even if it is hidden visually, it will be seen and interpreted. It is necessary to remove it from the HTML structure and then to add the new one. – Maniac Apr 09 '23 at 10:19
  • Noted. thank you. – Rob999 Apr 10 '23 at 13:26
  • 1
    If you need to remove the theme's initial H1 tag on every post/page you might consider modifying your theme to remove it by default. Lot's of sites use display:none to manipulate menus and many other layout items without harming their rankings. However, if you use display:none to manipulate SEO, then it's possible Google might see that and flag your site. – Trebor Nov 10 '23 at 14:37

2 Answers2

1

If you need to remove the theme's initial H1 tag on every post/page (even an individual post/page) you might consider modifying your theme to remove it by default.

Lot's of sites use display:none to manipulate menus and many other layout items without harming their rankings. However, if you use display:none to manipulate SEO, then it's possible Google might see that and flag your site.

See this question regarding display:none - How bad is it to use display: none in CSS?

Trebor
  • 3,270
  • 8
  • 25
1

Yes, hiding an h1 would probably affect your SEO, but I'm not sure how much. Part of me wants you to try it to see what happens.

The real answer is that your CSS needs to be fixed. Even using an !important to style your h1 would be preferable to display:none in my opinion.

keepkalm
  • 917
  • 4
  • 13