Kempwire.com

By Jonathan Kemp

Add a User Directory to Your WordPress Site

I’ve recently been experimenting with community on WordPress, and I wanted to enable user registration on a WordPress site. This was easy enough, but once a user has registered there is no easy way for them to interact with the site, other than the way they normally would.

With WordPress, you can display authors in your sidebar, but there is not really a way to display profiles for registered users. So I ended up writing another plugin to handle this. The WordPress Users plugin creates a directory of user profiles on any page you specify on your site. Each user gets their own profile page that displays the date they joined and recent comments. It has support for Gravatars and permalinks. User links are nofollowed. You can also tell search engines to noindex, follow the directory pages. Also, there are plenty of hooks to style it yourself with your theme CSS file.

The WordPress Users page is here, and you can download the WordPress Users plugin here. I hope you find it useful. Let me know of any problems or questions.

Noindex Your WordPress Login Page

If your WordPress blog has a public login page, you probably don’t want it to be indexed by search engines. To fix this, I wrote a plugin to add the “noindex” robot meta tag to your login page. It also works on your registration and lost password pages.

The Noindex Login page is here, and you can download the WordPress Noindex Login plugin here.

Turn Off Comment Pagination in WordPress

I recently noticed that I was having an issue with WordPress creating duplicate url’s that were being indexed by Google. Duplicate url’s in search engine results is what is known as duplicate content, which can penalize you in search engines. The url’s were being formatted like this.

http://www.example.com/pagename/comment-page-1/

Here is the original url.

http://www.example.com/pagename/

Both of these url’s were being indexed by Google. I immediately recognized that this could cause a problem with duplicate content, since the content of those pages are exactly the same. Searching my site, I noticed these url’s were being linked to from the Recent Comment widget in the sidebar.

A new feature in WordPress 2.7 is the pagination of comments. I’m not sure if this is turned on by default or not. Checking my options, I saw that this was turned on. Turning it off solved the problem. The widget now links to the normal url’s. The remaining issue is that duplicate url’s are now in the search results. To get rid of them, I added a line to my robots.txt file preventing them from being indexed. Within a few weeks, those duplicate url’s should be gone.

So if you are using WordPress 2.7, you should check your search engine results for these duplicate url’s. If it’s a problem, turning off comment pagination should fix it.

Nofollowing Your Categories in WordPress

I recently wrote a plugin to add the “nofollow” rel attribute to archive links in WordPress. I had a request to write a plugin that does the same thing for categories in Wordpress, so I created one. This plugin allows you to display category links in your theme without giving them any pagerank value.

The Nofollow Categories page is here, and you can download the plugin here. I don’t recommend using them both at the same time. My recommendation is to use one or the other. You want to give pagerank to one or the other, but not both.

Remove Unwanted Tags From Your WordPress Header

The function wp_head; found in the header.php template file adds unnecessary tags to your WordPress template. These tags are the RSD, or Really Simple Discovery, link, the Windows Live Writer Link and the WordPress version number. I wanted to add this important function to my themes, but I don’t want those tags that WordPress adds by default.

So I created another WordPress plugin to strip these tags out. This plugin will stop all 3 tags from being automatically added to your WordPress header. The WordPress Head Cleaner page is here, and you can download the plugin here.

Nofollowing Your Archives in WordPress

I recently wrote my first WordPress plugin. I was looking for a way to add the “nofollow” rel attribute to archive links in WordPress. I needed to be able to use them in my theme without giving them any pagerank value.

I found that the best way to do it was to create a plugin so that I wouldn’t have to modify the core files. Any way the Nofollow Archives page is here, and you can download the plugin here.

How to Fix Tags in Elgg

Update: My changes have been rolled into the current development version of Elgg, so they should be in the next release. So if you don’t want to implement these changes yourself, you should be ok waiting for the upgrade.

Tags are a really good way to organize content in Elgg. You can add tags to any piece of content you create, and the tags help you organize that content by grouping it together, however you see fit. But when I looked at the underlying code for the tags, I noticed that it wasn’t following the specification for the tag microformat. Not that big a problem, but not a hard problem to solve either.

To explain, here is an example of how Elgg currently formats tags.

<a href="http://www.example.com/search/?tag=elgg">Elgg</a>

According to the microformat specification, here is how tags should be formatted.

<a href="http://www.example.com/tag/elgg" rel="tag">Elgg</a>

So how do we correctly format tags in Elgg? Well, we can use an .htaccess rewrite rule to correctly format the url to the specification. Edit your .htaccess file in Elgg and insert this code at line #120.

RewriteRule ^([A-Za-z0-9-]+)/([A-Za-z0-9\+-]+)/?$ search/?$1=$2

That handles the url, but we need to rewrite the code in Elgg that displays the tags, so when you click on the tag, it goes to that url. To do this, open views/default/output/tags.php and edit line #49 to read like this.

$tagstr .= "<a rel=\"tag\" href=\"{$vars['url']}tag/".urlencode($tag) . "{$type}{$subtype}{$object}\">{$tag}</a>";

That should be it. It’s pretty simple actually. Now your tags should be correctly formatted to the tag microformat specification.

One important thing to note is that I have again modified core Elgg files, which means if I upgrade my install these changes will be overwritten. So if you follow these instructions, you should realize that. Yes, this is a no no, so I have again submitted a change to the Elgg core files in the bug tracker here. Hopefully, the developers will incorporate my code, or something like it so modifying the core files will no longer be needed. Or, if someone would write a plugin or create some decent plugin documentation on how to create something like this, it would also be appreciated.

I hate continually modifying the core Elgg files, but these are problems more mature software packages, like WordPress, have already solved. Yes, I believe Elgg is still in it’s infancy, but it’s fixes like this that will make people notice that this is serious software.

Popularity Contest No Longer Supported, Use Wordpress Popular Posts

Popularity Contest is a WordPress plugin that keeps a count of your post, category and archive views, comments, trackbacks, etc. and uses them to determine which of your posts are most popular. I have used it for almost as long as I have used WordPress, and it was a great plugin in its time. But it is time to declare it on life support at least, if not dead in the water.

The problem with Popularity Contest is that was last updated on Dec. 16th, 2007, and it is only compatible up to WordPress 2.3.1. The current version of WordPress is 2.7. If you have had Popularity Contest installed since then, the plugin functions fine. The problem is that it will no longer connect to the database for anything else other than to record information. If you try to reset values, which is a feature, it fails.

If you try to install it on a new version of WordPress, it fails because it will not create a new database, if one doesn’t already exist. You have to manually create the database on your own. Even then it may still have problems. Although there is a fix for those problems, there is no fix for the database connectivity problems other than manually modifying the database yourself.

As a result of these problems, I sought out a more current plugin that does the same thing. The plugin I found is called Wordpress Popular Posts. I’ve been using it, and I am really satisifed with how it works. You can call it directly from your theme, or it has a widget, if your theme is widget enabled. It is also more configurable, but very simple to install. It does create a new table in your database, however, to track page views, but I had no problems with it. It uses the existing WordPress data for everything else.

I am continuing to use Popularity Contest where I already have it installed and it is working sufficiently. I am using it on this blog, in fact. But for any new installs, I am using Wordpress Popular Posts. That is unless Popularity Contest ever gets updated to work with the current version of WordPress. If anyone else has abandoned it, I would like to hear what you are using instead.

Update: I’m so pleased with how Wordpress Popular Posts works, I’m using it on all my sites now, and getting rid of Popularity Contest.

Elgg SEO: How to Fix Your Title Tags

Update #1: My changes have been rolled into the current development version of Elgg, so they should be in the next release. So if you don’t want to implement these changes yourself, you should be ok waiting for the upgrade.

Update #2: The title tag for pages and files did make it into Elgg 1.5, but the blog title tag change got regressed somehow. If it was not an accident, then they did it on purpose. Either way, it is very amateurish in my opinion, which continues to be one of my complaints about Elgg. Anyway, you can still apply the fix below exactly as described, and it will work.

I’ve been writing about recently, and more importantly, how to improve it. I have said that Elgg needs some attention to SEO to be a serious solution. Even though Elgg developers have taken my suggestions recently, I couldn’t wait any longer and took it upon myself to dig into the Elgg source code.

My goal was to improve Elgg SEO by creating unique title tags within the content. I was able to create unique title tags for blog posts, pages and files, by adding the post title to title tag in the header, so that each title tag is formatted like this, “Site Name : Title.”

Here’s how you can do the same thing step by step.

To give your blog posts a unique title tag, go to mod/blog/read.php and uncomment line 38. Here’s how it should read.

$title = sprintf(elgg_echo("blog:posttitle"),$page_owner->name,$blogpost->title);

Now your blog post title tags should read, “Site Name: username’s blog: Post title.”

Next up is pages. To give your pages a unique title tag, go to mod/pages/view.php and insert this code on line 40.

$title = $pages->title;

Now your page title tags should read, “Site Name: Page title.”

Changing the file title tags was a lot harder, because there is not really a file view. You have to change it in the entity view. Up to this point, we have been modifying plugins files, which is fine because we are not modifying the core Elgg files. This means those changes won’t get erased by upgrading your Elgg installation.

But modifying the entity view requires modifying core Elgg files, so proceed at your own risk. To make the change, open up entities\index.php. Insert this code on line 40.

$title = $entity->title;

Modify line 57 to look like this.

page_draw($title, $body);

Then on line 60 insert this code.

echo $title;

Now your file title tags should read, “Site Name: File title.”

These were small improvements, but hopefully it will pay off in more search engine traffic to your Elgg site. I’ve submitted these changes to the Elgg code base here, here and here. Hopefully, the developers will consider integrating these improvements into the actual code.

I’ve tested this code, and it works. But I am not a developer, so if I’ve made any mistakes, I welcome suggestions for improvement. If this would be better done as plugin, I would love to have someone come up with an Elgg SEO plugin, as well.

Elgg and SEO

Update: I’ve posted a solution for fixing your title tags in Elgg.

So as I’ve written, I’ve been using a social networking software package called Elgg. So far I’m really pleased with how it works. In addition, it is open source with the ability to develop plugins for it.

However, Elgg is not without its problems. In fact, I recently posted a development wishlist for Elgg. Besides releasing an upgrade path to upgrade your 0.x Elgg installation to 1.x (a glaring error), at the top of my list is lack of SEO.

In my opinion, Elgg seriously needs SEO to be considered a useful product. I’m really not asking all that much here. The main thing it needs is unique title tags. This is a basic SEO requirement, and continues to be overlooked in Elgg.

For example, any item you create in Elgg, blog post, page, file, etc., lacks a unique title tag. In fact, they all have the same title tag, which is only the site name. This is bad for SEO because when your items show up in a search engine, there will be no descriptive text for that item. In addition, if your page shows up with other pages from your site, there is no way to tell them apart because the title tags are all the same.

The interesting thing is that this feature was present in Elgg 0.x but not in the new version of Elgg 1.x. All you would have to do to give each item a unique title tag would be to have the name of the site followed by the title of the item, i.e. the blog post title. This would make items posted in Elgg much easier to find in search engines, and as a result, bring more search engine traffic to each site. It seems like a simple thing, and, being that this feature actually exists in the groups and forums, it doesn’t seem that hard to add to the rest of the site.

The second thing that would be useful is search engine friendly url’s for pages. Search engine friendly urls are being used for blog posts and files but not for pages. This was something that was not present in Elgg 0.x but was added in 1.x.

I recently wrote a post about how to make the Elgg plugin directory more useful, and the developers followed every one of my suggestions. So I am writing this hoping that someone over there is still paying attention. At the least, it would be simple to write a plugin to solve this problem, or incorporate it into themes.

For you Elgg users and developers out there, what are some other ways SEO can be improved in Elgg?

Page 2 of 1612345...Last »

Copyright © 2005-2010. XHTML | CSS