Accessibility Navigation


ImageXY - Mac OS X Batch Photo Resizer

Checkout ImageXY - Painless image resizing for Mac OS X.

Quickly and painlessly bulk resize images, change image formats and create web-friendly photos for your website.

Available on the Mac App Store!

Using WordPress Tags as Keywords

Tag cloud visualization

Tags in WordPress allow you to organise your content with quick and easy Folksonomy. This can then be used to view or show other related data or fancy, but not very usable, tag clouds. Today we will see if we can’t make more use out of this information by adding it to our meta keywords for better SEO.

This is a simple piece of code that you can use in your WordPress templates that uses the posts tags as keywords in the <head> section of your code.

//get the page keywords
$strPageKeywords = "";
        while (have_posts()){
                $arrPostTags = get_the_tags();
                        foreach($arrPostTags as $arrTag) {
                                $strPageKeywords .= $arrTag->name . ', '; 
                        //default keywords if no tags are used
                        $strPageKeywords .= "";
        //default tags for the rest of the site
        $strPageKeywords .= "";

You then have a PHP variable with the keywords in that you can use.

        <meta name="keywords" content="<?=$strPageKeywords;?>"/>

Then just start to tag your blog posts with descriptive tags and these will be used as the pages keywords and help you get better indexed in search engines.

About The Author

Jacob Wyke is a web developer from the UK who makes complex things simple on the internet. He develops a batch image resizer for Mac OS X called ImageXY which you should try if you ever need to resize anything for the web.

You should also follow him on twitter.