Archive for October, 2008

The Best Permalinks Structure

The default permalink structure for wordpress is something like his: http://blogname.com/?p=123, where “123″ is the internal ID of the post. I totally disagree with that structure and I’m not the only one in this world who thinks meaningless and useless for SEO purposes. It doesn’t help in any ways your rankings or your placing in the SERPs. This is obvious because one of the most important rules for SEO is having the keywords in your URL/titles. Honestly, I don’t understand why they choose that as default, but that’s not so important.

The pretty structure is something like this: http://blogname.com/2008/10/27/some-post-name. Now, the big question is: which permalinks structure is the best one? I’ll let you decide that, but, for me, one thing is for sure: the post name has to be in the URL. WordPress comes with few options for the permalinks structure:

  • Day and name, which is actually ‘year, month, day and name’. This helps the reader too as it’s like searching through the blog archive. You have the year, the month, the day, so you can easily find the post.
  • Month and name, which is almost the same with the first option just that the day is missing
  • Category and post name, for instance http://blogname.com/some-category/some-post-name. This format is used on a lot of new blogs lately. Some say that the category name is relevant to the post name, and hence improve SEO.
  • Post name, meaning just blogname.com/some-post-name. This 4th one is used on a lot of blogs as well.

WordPress offers you the possibility to go even further with your imagination, using the structure tags in your permalinks to create a custom permalinks structure. According to ‘codex’, these are the structure tags you can use in your permalinks settings page:

  • %year% – The year of the post, four digits, for example 2004
  • %monthnum% – Month of the year, for example 05
  • %day% – Day of the month, for example 28
  • %hour% – Hour of the day, for example 15
  • %minute% – Minute of the hour, for example 43
  • %second% – Second of the minute, for example 33
  • %postname% - A sanitized version of the title of the post (post slug field on Edit Post/Page panel). So “This Is A Great Post!” becomes this-is-a-great-post in the URI (see Using only %postname%)
  • %post_id% – The unique ID # of the post, for example 423
  • %category% – A sanitized version of the category name (category slug field on New/Edit Category panel). Nested sub-categories appear as nested directories in the URI.
  • %author% – A sanitized version of the author name.

You can use ‘-’ or ‘/’ to separate them, eg: /%category%/%postname%-%post_id%/

This isn’t a SEO blog so I’ll let you decide which one is the best permalinks structure for your blog. I personally support having post name and id and nothing else. Why? It’s because your post name will contain your keywords. Therefore, if the URL is short, the keyword density will be high(the concept is called relative weight of keywords). I don’t encourage having only the post name in the title, and here’s why: if you do that, the rewrite rules may make it impossible to access pages such as your stylesheet or the /wp-admin folder. That’s why it’s best to include some numeric data in the post, for instance the post ID. This will prevent you from having 2 posts with the same URL (I know you wouldn’t name 2 posts the same, but you might have 2 posts with the same name in different categories, etc … you never know).

One thing I forgot to mention is that if you already made some posts and published them with the faulty structure, there is a plugin that will help you redirect the old URLs to new ones. Here’s the link.

Hope this helps,

Peter

How to Add Google Analytics to WordPress

Google Analytics is still the most used traffic analysis tool on the planet, although it seems a little bit old and slow for these times (it loads at a slow speed and shows the actual data few hours after any events occur on your website … ). WordPress & Google Analytics can work well together if you do it right.

Right now I’m using a plugin to add google analytics to my website, but there are few other ways to do that, depending on your imagination :).

First, let’s talk a little about this plugin. You can download it for free right here: Download Google Analytics for WordPress

Next, upload it to your “wp-content/plugins” folder and activate it from your plugins page in wp-admin. Once this plugin is active, you will have a new button in your settings sub-menu. Click on it and you’ll see this screen:

WordPress Google Analytics

Here you can paste your google analytics code. Please note that this plugin works with the old version of GA as I marked with red in the screenshot (I hope in the near future we’ll have a version that will support the latest script from google). Hit update options and you’re done.

Another thing, if you’re logged in, this plugin won’t show the code in your page, so if you want to check it’s there, you need to logout first.

A second option would be to edit the theme files. This is good and bad at the same time. Good because you don’t have to get stuck with uploading plugins and so on, and it’s bad because it won’t work once you update your theme (or switch to another one). So it’s up to you if you use this method or not.

Here’s how to do this: first, you have to know what files from a WordPress theme are used always. These files are the header and the footer (the others might be used or not while user navigates on your website). Therefore, you may put the google analytics code inside one of those 2 files. I recommend editing the footer.php file because google instructions say that you have to place their code before the </body> tag. We’ll do so.

To edit your footer.php file, go to “Design” \ “Theme editor” and select “footer.php” from the right column. Once it’s loaded in the textarea, paste your code before the </body> tag, just like in the image below and hit the “Update file” button.

WordPress Google Analytics

That’s it. You have installed Google Analytics on your WordPress Blog.

- Peter

(You can find an update for this post here)

WordPress Permalinks – How to Deal With Them

Few days ago I wrote a short tutorial on ‘how to make your title appear in your links’, but I guess I missed something from it because one friend of mine couldn’t make it.

Here’s the post in case you want to read it:

How to Make Your Title Appear In Your Links

The problem is that, by default, hosts don’t set folder permissions to allow writing for apache and WordPress needs to write the .htaccess file on your server in order for the permalinks to work. If you go to your permalinks settings and try to change their format and see the image below at the bottom of the page, this means you have a problem with your permissions.

Here’s how to deal with this.

If you have the ‘x’ theme on your cpanel admin area, read below. If you have ‘x3′ scroll down a little.

Once you’re logged into your cpanel, hit the ‘File Manager’ button:

Once it’s open, start browsing until you reach your blog root folder. To enter a folder, use the yellow icon near the folder name. If you click on the folder name you will get a list of options on the right upper corner.

Also, please note that your blog root folder might be on your cpanel account root folder or it might be in a subfolder. For instance, if your domain is called wordpress.org and you can reach your blog by typing that address, then you have to navigate to /public_html. If your blog is located at www.wordpress.org/somefolder/blog/, then you have to navigate to /public_html/somefolder/blog. If you encounter any problems with this step, please mail me or post a reply on this post.

Now you are in your blog root folder. You have to put there a .htaccess file. If you cannot see it in the listing, then it means you don’t have it and you have to create it. If you can see it, you only have to set writing permissions for it.

Here’s how to add the .htaccess file: click on “Create new file” and you’ll see a small box in the upper right corner of your browser. Put “.htaccess” inside and hit “Create”.

Now you have to set permissions for it. To do that, click on the file name in the listing

The contextual menu will appear in the upper right corner. There, click “Change permissions” and make sure the ‘user’ and ‘world’ writing permissions checkboxes are checked. When ready, hit “Change” and you’re good to go. Now you may go to your WordPress admin area and change the structure of your permalinks.

I’ll come back later with the screenshots for the ‘x3′ theme on cpanel as it’s a little different.

Take care,

Peter

How to Install WordPress

Ok … now you know what a blog is and you’ve been thinking of starting your own. You also heard of the term ‘wordpress’ but you don’t know exactly what is it all about. In just few words, wordpress is the most used blogging platform on the planet. It is a free open source platform that lets you create and publish your blog. You just install it on your website and you’re good to go.

There is really no difference between a blog and a regular website. It’s just that the blog means a specific type of website: a web log or a personal diary. That’s it.

WordPress will basically build your website. You can choose from various skins to make it personal. You can have widgets, banners and so on. You can organize your posts in categories, timeframes and the most recent ones appear by default on your home page. If you wish, you can change that setting to display a static page. WordPress also has a complete, well designed administration area where you can manage everything on your website: you can add new categories, create posts, add pictures, embed videos, music, add links and many, many more things, all in one single online administration area.

Installing it is really easy if you are familiar with uploading files through FTP to your website. If you don’t know what that is, then read this guide and you’ll find out. If it’s still too complicated, there are hosted versions also, which are free and don’t need to have a website. I recommend having your own name on the internet though …

I wrote a guide on how to install wordpress which you may download and read.

You can download it using the form in the upper right corner.

Get it now and start blogging :P

Peter

How To Post Articles With WordPress

Writing a post is a very important feature for wordpress … actually I consider it the most important feature. I’ll make it really short now and explain in just few words ‘how you can make a post on your blog using wordpress’.

It’s very easy. Basically there are 3 main ways that you can use to post on your blog. I’ll start with the most used, which is the one in the administration area. I assume this post will be read only by people new with wordpress, if you already made a post you know how to do it, so what I’m doing now it’s kinda` useless.  Ok, so, here we go: let’s say you installed your blog or someone else did it for you and you want to make a post. You must have the admin info (user and password) to do that, so if you don’t have them you must ask for them. Having those ready, you need to go to ‘yourblogurl.com/wp-login.php’. After you’re logged in, you will see your dashboard. That’s not important for now. You just need to click on the button named “Write” (you can find it in the upper left corner if you’re using newer versions). Once you click on that button, you’re automatically taken to the post writing area (using the same write button, you can go and write a static page or a link, but ‘post’ is the default option).

Now, you’re in the writing area. Enter the title, then start writing your post. Make sure your title is search engine optimized (eg. contains a keyword you want to target, etc). When you’re done, scoll down and you will see the “tags” area. There you must enter your tags(or keywords). That’s not a must, but it’s important for SEO purposes. If you scroll down even more, you’ll see the categories area where you can include your post in one or more categories. That’s about it. When you’re done, just hit “save” to save it or “publish” if you want other people to be able to see it. Please note that if you don’t publish it, it will still be saved, but it won’t be available for others.

That’s it, you wrote your first post using wordpress.

Earlier in this post I was saying about 3 ways to write a post on wordpress. The one above was the first one. The other two aren’t so much used, but they’re very useful. Another way to post to your wordpress blog is using the XML-RPC protocol. XML-RPC enables a background communication channel for to manage your blog. Don’t worry, it’s quite secure so you can use that too without being afraid of something.

It works like this. First, you have to enable it. You can do that by accessing the writing settings page (“Settings” > “Writing”). If you go to that page, you’ll see this:

Enable the WordPress, Movable Type, MetaWeblog and Blogger XML-RPC publishing protocols.

To have XMLRPC enabled, just check that checkbox and hit “Save changes”.

If you have this setting enabled, you can use external posting services to post remote, schedule posts, post multiple articles at once, buy content from PLR websites, etc (a lot of tasks, really). I’ll come back with more info related to XML-RPC in a later post.

The third way is ‘email publishing’. To be honest, I didn’t use that, but I assume it logs in to your email account, it grabs your email messages and posts them on your blog (based on some user/password of course as you could get a lot of spam emails going online as posts) – I strongly recommend being carefully with this one :)

Hope it helps and hope you enjoyed this post. If you did, please share it with your friends.

Thanks,

- Peter

Yes, I forgot my password

And guess what? I went to that page where you enter your email or username and receive a link on your email.

Pretty easy, right?

NO!

Unfortunately, when you install wordpress, it generates a key for you that will be used to recover your password. Therefore, in the email, you get a link like:
domain.com/blog/wp-recover.php?key=somestringhere.

Here comes the problem: wp includes the “&” when generating these keys (and for some reason it seems to include it everytime I install a blog, lol), but the “&” char is used to separate the request variables sent by GET. That’s why, when you click on that link, you get a “wrong key” error, because if the key is 1234567&9, wordpress will get only 1234567, which is wrong (duuh).

Solution? I have one that I use. I just open phpmyadmin on my server, go to wordpress database in the wp_users table and change that key to something else (of course, “1234″ won’t do as you might get up one day with all your posts deleted ). After I’m finished with that, I do the process again and I’m able to set a new password.

… Pfew

In this short post, I will teach you how to have a static page displayed on your home page instead of the regular: latest 10 posts (or at least 10 is the default number).

By default, wordpress displays your latest posts (latest first). However, this can be changed to show a static page for your home page. To change this setting, go to your settings menu and pick reading from there.

Please note that you must have a static page in order to display it. By default, WordPress creates a static page and puts it on your blog, but some delete it because of the “hello world” content (so did I). If you don’t have any static page on your blog, you won’t even be able to see that setting.

Here we go: on the reading settings page, you’ll notice you can choose between “latest posts” (the number of posts can be changed as well) and a static page. To make your home page static, pick static and choose one of your pages.

That’s it :)

Note: make sure you have a navigation panel or your sidebar includes a link to latest posts or archive or something. Otherwise, your visitors won’t be able to check your posts and will see only your static content.

Hope it helps,

- Peter

How to make your title appear in your links

I’ve seen this question many times on forums, so I thought it would be a good idea to make a post on how to have your post title appear on your links.

First, what does this mean? If you look in the address bar, you’ll notice that the URL is this one:
“http://www.wordpress-how-to.com/2008/10/14/how-to-make-your-title-appear-in-your-links”. This is an old SEO trick, now implemented in many web applications and yes, wordpress has support for it, just that it isn’t enabled by default.

The files/directories specified by the link don’t exist on your server, this is basically a redirection made by the htaccess file on your server. Therefore, when you hit “/2008/10/14/how-to-make-your-title-appear-in-your-links”, it will query the database for the post with that title and it will take you to index.php?p=somepostid. That’s all it happens in the background.

Let’s get to the point now. It’s very easy to enable this feature on wordpress. To do that, just login to your admin area, hit “Settings” (it’s in the upper right corner for the newer versions), then, from the contextual menu, pick “Permalinks” (or simply, put this at the end of your blog URL to access the page directly: “yourdomain.com/wp-admin/options-permalink.php”).

From there, you pick one of the options, which one you consider to be the best (I’m using the second: day and name) and then click on save.

Please note that your root folder (or blog folder if it’s not located in root) should be writable. If it’s not, wordpress won’t be able to write the htaccess file.

This is it. If you enounter any problems, just let me know via email or reply to this post and I’ll be happy to help you.

- Peter

Recommended plugins

Hey there!

Although this topic is changing all the time, it’s like a moving target, but I think it would be useful to list here the plugins I consider useful for a wordpress blog. I’ll modify this post in time, but for now, here you go:

  1. Monetize WordPress – Boost your CTR and response rate with more than 30%
  2. TweetMe for WordPress – A cool viral plugin to help your users spread the word about your website
  3. All in one SEO pack – I consider this one the most important in my list. Why? Because it offers you a lot of SEO options (without having to learn html, of course). For instance, you can have your blog title custom for the home page and custom for all your posts. You can add meta keywords and description (which, by default, wordpress doesn’t offer). In short: get it now, you don’t have anything to lose.
  4. Google XML Sitemap For WordPress – it builds a xml sitemap with all your posts, links, pages, etc and submits it to google, msn and others. Multiple options offered as well
  5. No-follow Free – it removes the no-follow tag from your worpress blog comments. I don’t know what to say about this one .. the no-follow tag somehow prevents automatic link building and prevents spam on your blog. How ? Well .. knowing that by default wordpress does put this nofollow tag on the links and therefore SEs ignore those links, people won’t spam your blog with comments. However, it’s up to you if you want to use it or not.
  6. Google Analytics – allows you to add your google tracking code into your blog without having to modify your theme files.
  7. WordPress Polls – allows you to add polls to your website, just like the one you see on my blogs sidebar. Once you create a poll, you have to add it as a widget. Contact me or the creator of this plugin if you need any help
  8. Social Bookmarks – with it, your visitors will be able to bookmark your posts and share them with their friends

Well … I personally consider these ones important. Depending on your needs, you may have other “top 5″ or “top 10″ lists. I would be happy to get this list bigger and bigger based on your comments, so, if you have other plugins to recomment, be free to do it and I will add them to this list.

Thanks for contributing.

- Peter

I was browsing the internet and saw something that got my attention. It will grab yours too, trust me.

I’m talking about wordpress security and vulnerabilities here and there’s much to say about it, so I’ve started a new category where to post.

The very first and most important thing you need to do to help your blog stay safe all the time is to keep it updated to the latest version. That’s the most safe (at least that’s what they say). Everytime a new bug/security hole is found, the platform gets updated with a fix and then the bug is published. In short words, everybody knows about it.

If you don’t want to mess with ftp and downloads and so on, you might want to use a plugin that does your updating automatically. This way you’ll always have your wordpress blog up to date. I don’t remember the name of that plugin because I don’t use it, but if you wish to install it, do a simply search on google or on wordpress.com site and you’ll find it pretty fast. I don’t use it because I don’t like having too much “foreign” code on my server… you never know what can happen to your database or whatever. Therefore, I prefer to update it manually.

Oh … and by the way, I was talking about plugins. When you get a new plugin, make sure it’s a safe one. Don’t install any plugin just because the owner is saying on his website that plugin  will help you do this or that. Maybe use a test blog to check the plugin, or maybe get a software engineer to analyze it carefully. This way you’ll know it isn’t a threat for you or your business.

Google Analytics integration offered by Wordpress Google Analytics Plugin

Hey, sorry to hear that!

Do you want to see this message again while on this website?
(pick an option)