We are meet again with a new topic, “Creating Custom Fields in WordPress”, when creating content in wordpress for both post and page pages, we often want to add new fields to accommodate the data/information we need.
To “Create Custom Fields in WordPress” you can follow these steps:
Note: I use this method to add meta keywords data in the head section for each post page and page with wordpress version 5.8.3
create a new post then click the “dot 3″(1) in the top right corner, then click “preferences”(2) then click “panel” (3) then activate the “Custom fields” button(4) then click “Enable & Reload ” (5)

2. If successful, new fields will appear at the bottom of the post as shown below

for my case, I want to add a field to accommodate data for meta keywords, then for the name column I fill it with keywords and I fill in the value with the keywords I want to use, as shown below

to display it I use code
while ( have_posts() ) : the_post();
echo ‘<meta name=”keywords” content=”‘.get_post_meta($post->ID, ‘keywords’, true).’”>’.”\n”;
endwhile;
I put it in the header.php section, you can use other methods according to your individual needs.
that’s all for now, hopefully it will be useful
thank you
