I have the theme Hatch and I can’t figure out how to change the meta-description of the home-page. It is not an actual page, it is the default view for posts.
Have searched everywhere for an answer but really can’t figure it out. I have downloaded the plug-in SEO by Yoast, but only seem to be able to change the meta-description on pages and posts…?
You do not need to add Yoast if you only want to add meta tags to the homepage. Just some minor editing will save you on performance.
You can use the is_home() function.
Insert this to your
header.php
:You can also do by this
this will set different description for home and other.
I had the same issue, and since this post is one of the first results that comes up in Google, I wanted to share the solution that I found.
The code that Christine provides is good, but the problem is that you shouldn’t generally edit the
header.php
file directly, since your changes would be erased when you update the theme.The solution is to insert the code into your own plugin, and to use an action hook in order to insert the description into the header:
The use of (is_home() || is_front_page()) ensures that the meta description displays for your website’s homepage, regardless of how it’s configured.
For WordPress SEO (by Yoast) – it’s under titles and meta – there will be a home tab. The All in one SEO plugin gives the option to autogenerate or customize the description
I made an SEO video using Yoast: https://www.w3bdesign.ca/free-wordpress-seo/