There’s a plugin called Tags in the Head which can do what you’re asking:
https://www.maxpower.ca/wordpress-plugin-tags-in-the-head/2006/04/17/
I have written something for this, so hopefully you’ll find it useful:
https://seo.blorc.com/seo/tagging-meta-keywords/