Word Press (CMS) SEO
Using word press as CMS is popular, however adding keywords and description to each page might be confusing for some of us, following is a quick solution to apply meta tags
How to Apply SEO for Wp
There are plenty plugins which offer SEO integration for word press, tho most of them suitable for blog. What if we like to use word press as a CMS. Here is how to do so in two quick steps:
Step 1: Finding the post number for each page
Step 2: Write PHP statement for each page and place them in “header.php”
Finding post number
Log in to wp-admin » click on pages » click on edit » hover over the page name and page number will show up at the bottom on browser task-bar

Writing the PHP Statement
Lets say we have 4 pages in our website( Home | About | Portfolio | Contact ), after finding the post number for each page:
- Home post id = 4
- About post id = 2
- Portfolio post id = 6
- Contact post id = 8
We are ready to apply them in our PHP statement:
<?php if (is_page('2')) { ?>
<meta name="keywords" content="keyword1 for about page, keyword2 for about page, ..." />
<meta name="description" content="description1 for about page, description2 for about page, ..." />
<?php } else if (is_page('4')) { ?>
<meta name="keywords" content="keyword1 for home page, keyword2 for home page, ..." />
<meta name="description" content="description1 for home page, description2 for home page, ..." />
<?php } else if (is_page('6')) { ?>
<meta name="keywords" content="keyword1 for portfolio page, keyword2 for portfolio page, ..." />
<meta name="description" content="description1 for portfolio page, description2 for portfolio page, ..." />
<?php } else { ?>
<meta name="keywords" content="keyword1 for contact page, keyword2 for contact page, ..." />
<meta name="description" content="description1 for contact page, description2 for contact page, ..." />
<?php } ?>
We are done, place the above script in “Header.php” between
<head></head>
tags.
Leave a Reply
