Optimize your pligg site for better SEO with these guide tutorial instructions

Pligg Security VulnerabilityAnybody that has used the pligg cms system will know that straight out of the wrapper it isn’t optimized as much as it could be for SEO (search engine optimization). Some of the more evident problems pligg can pose are URL structure, multiple duplicate content Urls, non seo optimized page titles, and no site-maps for Search Engines. At the moment Pligg is still BETA with larger bugs and features to attend to so here at Social CMS Buzz we decided to show you guys how to optimize your Pligg site to achieve better Search Engine Rankings.

First off let’s begin by covering the URL structure of pligg. Most of Pligg’s Rewritten URL 2 system works fine if a little messy here we will show you how to clean this up to something Google will prefer.

Pligg Google Friendly URL Rewrite
A default Pligg story URL once rewritten looks like the example below.

http://www.designfloat.com/General/Joshua_Glenn_Taking_Things_Seriously/

What stands out is the use of _ Underscores within the URL, Google prefers the use of a hyphen/dash – as a separator and for more information on this read the Blog post by Matt Cutt’s who works for Google. This excerpt below taken from Matt’s blog post should indicate exactly why a hyphen/dash is a better separator.

Quote: Matt Cutts

With underscores, Google’s programmer roots are showing. Lots of computer programming languages have stuff like _MAXINT, which may be different than MAXINT. So if you have a url like word1_word2, Google will only return that page if the user searches for word1_word2 (which almost never happens). If you have a url like word1-word2, that page can be returned for the searches word1, word2, and even “word1 word2″.

So how do we fix this? luckily Adam over at Pligg Template has provided some code to clean up the Pligg URL system to be more Search Engine Friendly. We will use some of that code to achieve a nice clean URL system like below.

http://www.designfloat.com/general/joshua-glenn-taking-things-seriously/

Open libs/utils.php and FIND

$output = utf8_substr($input, 0, 240);

REPLACE WITH

$output = utf8_strtolower($input, 0, 240);

libs/utils.php and FIND

        $output = str_replace("\"", "", $output);

REPLACE WITH

        $output = str_replace(" - ", "-", $output);
$output = str_replace("_", "-", $output);
$output = str_replace("---", "-", $output);
$output = str_replace("\"", "", $output);
$output = str_replace("--", "-", $output);

Now you have lovely clean and Google friendly URL’s note for categories you must manually create categories in lowercase from the Admin section of pligg or your htaccess won’t work. Also this change should not be applied to an existing site unless you know how to 310 redirect content that is currently indexed under the old url system or you have a very small site with very little indexed story content.

SEO Friendly Page Titles Hack
Next up we have Pliggs page titles, this is a really simple little hack that anyone can do I around 2 minutes and it should work on any version of pligg although i have only tested it with v9.8.2.

What this hack does is more commonly know or referred to as reversing page titles or optimal page titles. Here are some examples of this below.

Original Pligg Story Title
Design Float – Joshua Glenn: Taking Things Seriously

SEO’d Pligg Story Title
Joshua Glenn: Taking Things Seriously / Design Float

Original Pligg Search and Tag Title
Design Float / Search Results For: design

SEO’d Pligg Search and Tag Title
Design Search Results / Design Float

Original Pligg Search and Tag Title
Design Float / Tage Cloud

SEO’d Pligg Static Page Title
Tag Cloud / Design Float

As you can see the most important keywords are now located farthest to the left in the page title. Below are the instructions to achieve this….

Open template/yourtemplate/pligg.tpl and FIND

<title>{if isset($pretitle)}{$pretitle}{/if}{#PLIGG_Visual_Name#}{if isset($posttitle)}{$posttitle}{/if}</title>

REPLACE WITH

{if $pagename eq "story" || $pagename eq "topusers" || $pagename eq "cloud" || $pagename eq "tools"}
<title>{$posttitle|substr:3} / {#PLIGG_Visual_Name#}</title>
{elseif $pagename eq "search"}
<title>{$posttitle|substr:3} search results / {#PLIGG_Visual_Name#}</title>
{else}
<title>{$pretitle}{#PLIGG_Visual_Name#}{$posttitle }</title>
{/if}

Open template/yourtemplate/search_centre.tpl and FIND

{if isset($templatelite.get.search)}
<h2>{#PLIGG_Visual_Search_SearchResults#} {$templatelite.get.search|sanitize:2|stripslashes}</h2>
{/if}
{if isset($templatelite.get.q)}
<h2>{#PLIGG_Visual_Search_SearchResults#} {$templatelite.get.q|sanitize:2|stripslashes}</h2>
{/if}

REPLACE WITH

{if isset($templatelite.get.search)}
<h2>{#PLIGG_Visual_Search_SearchResults#} {$templatelite.get.search|sanitize:2|stripslashes} search results</h2>
{/if}
{if isset($templatelite.get.q)}
<h2>{#PLIGG_Visual_Search_SearchResults#} {$templatelite.get.q|sanitize:2|stripslashes} search results</h2>
{/if}

The last step is to go to your Admin Panel / Modify Language and filter for “Search results for” remove both these pieces of text by editing and deleting the text then clicking save. You should be left with a completely blank text field.

Completed and your pligg site now has wonderful SEO Optimized Page Titles.

Pligg Duplicate Content
Pligg story pages have a few URL’s that can be indexed by the search engines this can amount to duplicate content in their eyes, The easiest way to fix this is by a robots.txt file that is uploaded to your plug root directory.

http://www.designfloat.com/Programming/Elemental_Conditional_Content_with_CakePHP/
http://www.designfloat.com/story/title/Elemental_Conditional_Content_with_CakePHP/

Both the URLs above point to the same page a can be indexed by search engines which mean’s duplicate content, the fix is below…

1. Create a new blank text file and name it robots.txt.

2. Copy the text below and paste it into you robots.txt file.

# All robots will spider the domain
User-agent: *
Disallow: /templates/
Disallow: /3rdparty/
Disallow: /libs/
Disallow: /modules/
Disallow: /plugins/
Disallow: /internal/
Disallow: /backup/
Disallow: /thickbox/
Disallow: /api/
Disallow: /evb/
Disallow: /avatars/
Disallow: /admin_index.php
Disallow: /admin
Disallow: /story.php
Disallow: /login.php
Disallow: /user.php
Disallow: /js/
Disallow: /img/
Disallow: /story/
Disallow: /story/title/

3. Upload the newly created robots.txt file to you pligg rott directory overwriting the existing file if asked.

Done no more duplicate content.

Pligg XML Sitemaps Module v9.8.2 Only Works With URL Method 2 Enabled In Pligg
PatchLog.com had previously released a sitemaps module for an older version of pligg v9,7 I think, this module stopped working after the release of v9.8 of pligg. We have played around with the files and have it working in v9.8.2 of pligg instructions and download below…..

Download: XML Sitemaps for pligg v9.8.2

1. Download the module above.

2. Unzip and upload the folder xml_sitemaps to you pligg /modules folder.

3. Go to Admin / Modules Management and activate the Plligg Sitemaps Module.

4. open you .htaccess file in you pligg install’s root directory and add the code below to the very bottom.

RewriteRule ^sitemapindex.xml module.php?module=xml_sitemaps_show_sitemap [L]
RewriteRule ^sitemap-([a-zA-Z0-9]+).xml module.php?module=xml_sitemaps_show_sitemap&i=$1 [L]

Done 🙂

Go to http://yoursite.com/sitemapindex.xml to check that it is working.

Now submit your sitemaps to Google 🙂

I know this has been a long article and if you have stuck with it you will now have a nicely SEO’d pligg site that should achieve better results in Google and other search engines. Any questions or help required please leave a comment and if you found this helpful give it a Digg below. Hopefully we might see future updates of pligg contain some of these changes.

If you enjoyed this post, make sure you subscribe to my RSS feed!

Article Details

#

Author: on December 11th, 2007

Category: Pligg Tutorials

Tags: , , , , ,

  1. Lincoln says:

    Hey There,

    This is really a question for the pligg forum as i am positive it would need some changes to the core files along with the template files but it should be possible, you could always try editing the files yourself as i doubt Pligg will be willing to help you on this one.

  2. Alexiel says:

    will it work on Pligg CMS 1.0.3?