How to Add Meta Description on WordPress without Plugins


Image and video hosting by TinyPic

Learn How to add meta title and description without using any plugins

Here you can learn, how to add meta description on WordPress manually or without any plugins, with simple and easy guide, Yoast Seo is one of the best plugins for adding meta description and best tool for onpage SEO, but sometimes you may need to add this manually or without plugins.

Related Article

Adding Home Page meta description on WordPress:

if you want to add home page meta description manually, you can use this code and past it on function.php from theme editor, and then click to save changes. It’s Done

The code!

#Homepage Meta Description
if( is_home() || is_front_page() ){
	$meta_des = "Enter your homepage meta description here"; #Edit here
	echo '<meta name="description" content="' . $meta_des . '" />';
}

You just need to change the description as your requirement.

Adding meta description on every single WordPress post:

You can add on every single post meta description on WordPress, without plugins in five simple steps

Step 1: Open the post you want to add meta description from to Post editing on WordPress dashboard section.

lk

Step 2 : Click on screen option from (right top corner) of dashboard and mark tick on “Custom Fields” function.

lk2

Step 3 : Scroll down your post and there should be visible “Custom Fields” function, 

cus

Step 4 : Click to “Enter new”, then put “description” text in “Name” field, as well put your meta description in “Value” field, which will describe and concise your website post, and helps to optimize you site in search engine. (repeat this process on every single post while adding meta description)

cuss2

Final step 5 : you need add this code in “function.php” from theme editor. It’s Done!

#Single Page Meta Description
if( is_single() ){
	$des = get_post_meta( get_the_id(), 'description', true);
	if( ! empty( $des )  ){
		$meta_des = esc_html($des);
		echo '<meta name="description" content="' . $meta_des . '" />';
	}
}}
add_action( 'wp_head', 'add_custom_meta_des', 4 );


Comments

comments