LATEST >>

Welcome Here And Thanks For Visiting. Like Us On Facebook...

EXEIdeas – Let's Your Mind Rock » WordPress / WordPress Snippets » Use Post Categories As Post Meta Keyword Tags In WordPress?

Use Post Categories As Post Meta Keyword Tags In WordPress?

Use-Post-Categories-As-Post-Meta-Keywords-Tag
SEO meta keywords tags are still important but some SEO experts says that its nothing. But what if you will add then it will help SE to find out your post when someone target your keywords. NOw as everybody cant add related keywords to there post and WordPress also dont have any option to add by default then you have a way to do this.

In WordPress, there are many plugins for SEO and every plugin have this option if you are not able to write meta keywords for every post manually but you better know that plugins can cause a heavy load on your hosting and also make your blog unsecure. So its time to leave using plugins for keywords in WordPress as we also hate WordPress plugins.

You can also view out other article in that you can Use Post Categories As Post Meta Keyword Tags In WordPress?. So here below we have some codes that will generate your WordPress posts keywords categories and will add automatically on every post page dynamically. It will also add tags on Home Pages, Archive Pages, Search Pages, 404 Pages, Category Pages, Tags Pages so your every blog page will contain keywords tags.

Table of Contents

Recommended For You:
Highlight Text And Share That To Your Twitter Tweet?

Features:

1.) Theme Function(function.php) file code.
2.) Header(header.php) file code also.
3.) Will make your Categories as keywords.
4.) Also add keywords on non-post pages.
5.) No PLugin Required.
6.) Its a SEO Snippet.
7.) Light Weight code.
8.) Easy To Add.
9.) Every version of WordPress compatibility.
10.) Post Categories needed.

How To Use Post Tags As Post Meta Categories Tag In WordPress Without Any Plugin?

Step 1:) Copy the below code and Paste in in your Theme Function(function.php) file.

/* ------------------------------------------------------------------------- *
 * Meta Keywords For SEO (Categories)
 * Shared By EXEIdeas(www.exeideas.com)
/* ------------------------------------------------------------------------- */
function seometakeywords(){
if (is_single()) :
$posttags = get_the_category();
foreach((array)$posttags as $category) :
$seometakeyword .= $category->name . ',';
endforeach;
else:
$seometakeyword = 'keyword1, keyword2, keyword3, keyword4, keyword5';
endif;
echo '<meta name="keywords" content="'.$seometakeyword.'" />';
}

Step 2:) Now Copy the below code and Paste in in your Header(header.php) file before </head> tag.

<?php seometakeywords(); ?>

Step 3:) Save and you are done.

Customization:

1.) Just change keyword1, keyword2, keyword3, keyword4, keyword5 with your default keywords so except your WordPress posts pages, it will use the below tags like on Home Pages, Archive Pages, Search Pages, 404 Pages, Category Pages, Tags Pages so it mean you will be SEO rich without any plugin.

Recommended For You:
How To Change The Site URL Without Logging In WordPress?

Theme Files Editing Warning:

Keep in mind that every code that you will add in your themes files will be removed when you will change the theme. So after changing your theme, you have to follow this article again and you will get everything back same as it is now.

Last Words:

This is what we have and shared in easy steps for newbies so that they can easily know how it works. Stay with us because we are going to share a whole guide step by step about WordPress and make it easy for you. If you liked it then share it and be with us to get next tutorial. If you have any problem then feel free to ask us. We will help you with what we can or have.

You Like It, Please Share This Recipe With Your Friends Using...

Be the first to write a comment.

Leave a Reply

Your email address will not be published. Required fields are marked *