Please,
Guide me how to add each post tags keyword as a meta keyword in each post’s head section.
i tried but showing category keyword as a meta keyword. (By adding below function)
applied function:
function add_meta_tags() {
global $post;
if ( is_single() ) {
$meta = strip_tags( $post->post_content );
$meta = strip_shortcodes( $post->post_content );
$meta = str_replace( array(“\n”, “\r”, “\t”), ‘ ‘, $meta );
$meta = substr( $meta, 0, 125 );
$keywords = get_the_category( $post->ID );
$metakeywords = ”;
foreach ( $keywords as $keyword ) {
$metakeywords .= $keyword->cat_name . “, “;
}
echo ‘<meta name=”keywords” content=”‘ . $metakeywords . ‘” />’ . “\n”;
}
}
add_action( ‘wp_head’, ‘add_meta_tags’ , 2 );
right now, i am using wordpress SEO plugins.
want this for each post,
<meta name=”keywords” content=” wan’t current post tags comma separated in head section of each post”>
Hello,
Unfortunately the code will not work in it’s current state. However this request falls beyond what support can offer you. We recommend hiring a freelancer to help out in these cases if you really need this customization. Sorry, but we are a small team and time does not allow us to tackle such tasks. We try to help out where we can.
You can hire a freelancer from sites like studio.envato.com.
Thank you for your understanding.
Thanks Chris S for reply,
Bro, i want post tags not categories, Like all other websites showing in right way.
Please help little bit more,
So, how can i get tags as a meta keywords for each post given after post.
Please, give me code so i can place it in function file and fetch the correct result.
Only my site missing this meta keyword,
Thanks
