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, 2021 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.
    – user145078
    Mar 30, 2021 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, 2021 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.
    – user145078
    Mar 30, 2021 at 23:41
  • Generally none of that stuff should be added to header.php. It should be added via a plugin. Mar 31, 2021 at 1:49

1 Answer 1

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 and acknowledge you have read our privacy policy.