In order to do SEO of WordPress sites, many people use SEO plugins.
But, if you are a small web-site (such as our demonstration site) owner, you maybe think plugins are too heavy for your site.
So, today, we will guide you how to put the basic meta-tags "robots", "description", "keywords", "canonical" to the Posts-Articles without plugin. Our DEMO site runs on the way.
How to put meta-tags in a Post-Article
- "Keywords": made by "tag"
- "Description": made by the valuethat you wrote in the "Excerpt" column
- "Canonical": made by the value that you wrote in the "Custom Fields" column
- "Robots": made by the value that you wrote in the "Custom Fields" column
How to create meta tags for a Post-Article
- (1) Create a PHP file. In this article, for the sake of convenience, the file name is "header-SEO.php".
- (2) Put header-SEO.php into header.php. Put it above head> of header.php. In order to do so, copy and paste the contents in the frame below.
- (3) Click "Posts" on your WordPress Admin-Window, and open the article you'd like to do SEO. If the "tag" column is empty, write (a) tag(s).
- (4) Write the character corresponding to the "description" on the "Excerpt" column of the "Posts-Window". 150-160 characters would be good. Count the number of characters by using the "Counting Letters of the Rainbow-Link".
- (5) To the "Custom Fields" column of the "Post-Window", create a name called "meta_canonical". And copy and paste a permanent link to the "value" field. It is corresponding to the "canonical" of the meta-tag.
- (6) To the "Custom Fields" column of the "Post-Window", create a name called "meta_robots". And write "index" to the "value" field. It is corresponding to the "robots" of the meta-tag.
- (7) Open the "header-SEO.php", and copy and paste the contents of the frame below.
If your WordPress displays robot tag in header.php doubly, please do (A)(B) below.
(A) Open /wp-includes/general-template.php.
(B) Comment the line blow:
echo "<meta name='robots' content='noindex,follow' />\n";
//echo "<meta name='robots' content='noindex,follow' />\n";