0

I am making a theme for WordPress and I have noticed that most themes does not have meta in them Is there any specific reason for this?

Am I allowed to put custom metas such as keywords that are SEO related while publishing to WordPress directory?

Thanks

5
  • I don't see anything in the theme review requirements, but there's a link to a Slack channel there where you could ask? If you do, please come back and post the answer here. – Rup Mar 30 at 23:12
  • @Rup Okay thanks. I also didn't see anything like that, asking because most of the themes including twentytwentyone does not it have in base theme. Head should have a title as per HTML validator. – Latheesh V M Villa Mar 30 at 23:29
  • Oh, if you meant the actual <title> tag then the modern way is add_theme_support( 'title-tag' ); and let WordPress itself generate it in wp_head. (And that's actually mandatory now.) I thought you meant <meta> tags - I don't know if there's any standard for that. – Rup Mar 30 at 23:32
  • @Rup That's the part that is missing. Thank you. I will check more on having meta-title, meta-description. or maybe I will control it with an action or option. – Latheesh V M Villa Mar 30 at 23:41
  • Generally none of that stuff should be added to header.php. It should be added via a plugin. – Jacob Peattie Mar 31 at 1:49
0

No you shouldn't. This is not the theme's job. Your theme's header.php just needs to include wp_head(), which will allow WordPress and plugins to add any necessary tags to the <head>.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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