Optimize Brian’s Threaded Comments for SEO
July 16, 2008 By: Justin | 8 commentsI’m a big fan of Brian’s threaded comments and so are several other bloggers. The plugin is designed to allow you to directly respond in a thread to specific people who leave a comment. Its a great way for you and your visitors to interact in your comments. This increases comments, which is great for SEO… but I have a problem with this plugin. It inserts a MASSIVE amount of JS and CSS directly into every single page of your blog. This fills your page with junk, increases file size, and increases loading speed. I like to keep as much JS and CSS in external files as possible.
I suggest cleaning this up and I’m surprised that nobody does this. If you don’t know how to clean this up by hand, I made it really simple for you.
Cleaning up Brian’s Threaded Comments
(If you have no experience modifying files, back stuff up first)
Step 1
Save this text into a .js file. This is an external javascript file. If you have never done this, open up notepad, put in the text, save as, name what ever you want and add the .js. Or you can simply download my comments.js Upload this to your server. Note the URL to the location of the file.
Step 2
Open the CSS for your theme and insert this code. You will need to modify it where I have commented. Insert your address into the CSS. Replace the url.com with yourdomain.com.
Now paste it into your stylesheet. If you do not know how to do this, go to your dashboard, then design, then theme editor, then Stylesheet (at bottom), scroll to bottom of style sheet, paste code, save.
Step 3
Download this modified plugin. Open it up in your php editor or in notepad.
On line 151, you should see this code:
<script type=”text/javascript” src=”http://url.com/js/comment.js”></script>
It is about 2/3 through the code.
Change the URL to the URL from step 1! Replace http://url.com/js/comment.js with the URL of your js file.
Step 4
Save and upload the new modified plugin. Write over the old one. If you have wp-cache turned on, clear your cache. All your pages should now be much cleaner.
What Changes Were Made
The plugin use to contain the CSS and JS required to run the comments. We simply placed the CSS and JS into external files. Then I took the plugin and removed the hardcoded CSS and JS. The plugin now only prints out the link / call to the external javascript file. Google does not have to make its way through a wall of code before it finds your content.
Tagged With brians threaded comments, Wordpress, wordpress plugin, wordpress seo
Related PostsBANS Template Modification
One important part of having a successful BANS site is having a good template. You don’t need to spend hours developing a theme, but you can increase your sales by
Increase Comments - Sneaky Experiment
A simple experiment to increase my site’s exposure and comments. Its a little sneaky, but I’m curious what effect it’ll have.
Share and Enjoy:
These icons link to social bookmarking sites where
Find Dofollow Blogs
Learn how to find dofollow blogs to use to build links. Post talks about dofollow directories and lists, dofollow search engines, and the use of footprints to find dofollow blogs.
Share
How to SEO a Wordpress Template
I recently offered to SEO Wordpress themes for for my visitors. This lead to some comments about how to SEO a Wordpress template and what I would be doing. I
Zombie Sniper SEO Wordpress Theme
Releasing a new theme. It is inspired by the Transblack theme, which Vic suggests for usage on an Adsense niche blog. It is meant to generate high CTR. I took















Great stuff. Never knew this plugin could still be improved like the way you described. Anything for better SEO is my plate of meat!
btw Costa, love your avatar!
Thanks for the information! I use Brian’s Threaded Comments on most of my blogs, and I certainly appreciate anything to keep loading speed down.
I’m bookmarking your post so I can clean BTC up next time I have a few minutes to sit down and do it!
thanks for the comment dcr. Yeah, I’m a big fan of the plugin, but the code it puts into your header is nasty.
If you need any help with it, let me know
Justin,
The link to the modified plugin in step 3 is not working.
my bad, I fixed it
Thanks for the advice…never realized it took up so much space.
Hi Justin!
I’ve just been down this road to get nested comments working on my blogs, and I opted for Ajaxed Wordpress, because it has a control panel with masses of options, like live preview, individual post options, post navigation, most features work without theme editing, and this was the biggie; “This module updates a static file when options are saved rather than reloading WP to generate the core JS and CSS files.”