This is part one of an as of yet undetermined amount of posts in which I will try to explain how to improve your search engine rankings for your PHPmotion website. I probably won’t be covering the actual marketing but will be providing code, ideas & examples of ways to improve your website.
Let me know if you find it useful and I’ll get started on more posts!
Do not use duplicate title & meta tags!
This is easily missed as the keyword & description tags are invisible to regular visitors, they only show up within the source code. Having the same titles on different pages is missing out on a great opportunity for getting some keywords picked up in search engines.
For example the featured, recent, most viewed & most commented videos all have the same title & meta tags! This is not good!
Here’s a simple way of fixing this and can be used in pretty much any of the .php files:
$page_title = "Your page title will go here! - $site_name"; $description = "Enter a description for the page here, descriptions are often used as the small part of text that shows in search results and shouldn't exceed 150 or so characters (the amount Google display in results)."; $keywords = "comma,separated,words,or short, search keywords";
Meta keywords aren’t used so much now as the search engines prefer to scan the actual content of your page rather then trust what you enter.
So where do you stick this code into your files? Most of the time anywhere before this will be fine except in certain files (more on that in a bit):
$TBS = new clsTinyButStrong;
Try it out now in category_home.php.
But wait I hear you say, I want to display the name of the category! Good thinking! So here’s how you go about it, take the code had earlier with a few minor adjustements:
$page_title = "Watch $channel videos – $site_name"; $description = "View all videos in the $channel category, watch, rate and comment on $channel videos."; $keywords = "$channel, $channel videos, popular $channel vids";
Now that’s much better. Of course you can (and should) take this a lot further. Remember you will need to replace $channel with other variables (and don’t forget to change the descriptions & keywords around a bit). Some pages not to miss are seemore.php ($see_more_title), audio.php (also $see_more_title).
If you find this useful let me know below! Any questions just ask!
Update: How to add this for sub categories
At the bottom of the file just before adding the above code add the following:
if($sub > 0) {
$channel = $channel_name;
}
[...] to add? Search engines will love it, users will too. Add this to a smart bit of marketing and some optimized seo and watch your site [...]
This works great, but I’m having a problem using this with subcategories. Do you know what the additional PHP is to sort out the subcats?
Thanks!
Ryan, I’ve updated the post with code to solve this.
[...] 2 of the PHPmotion seo series is now done (part 1 here)! In this article I will be concentrating on improving the .htaccess file to remove duplicate [...]
I modified the files but when I browse any of the pages, I still get the the same title; I ran a few test and noticed that the tag in Main_1.htm is being used and the changes I made in each of the files are being ignored
Any thought?
Thanks
Naija
I also found this in the config.inc.php… “OVERALL GENERAL META NAMES Description AND Keywords SETTINGS
IN main_1.html THESE ARE RE-SET while viewing media dynamically”
But the description and keyword settings in MAIN_1.htm does not appear to be resetting when loading media dynamically
Nice post, thanks for good tips
@Naija @ben This will fix the issue that Naija mentioned.
I think that line #3 of your code should read….
$tags = “$channel, $channel videos, popular $channel vids”;
Note I changed $keywords to $tags.
P.S. I have no clue what I’m doing with PHPmotion so I could be wrong.