WP These are very easy to do stuffs, nothing complex yet in time you will find it useful. Most no-tech blogger intend to do everything through plug-ins, but why install dozens of plug-in while you can get away with just adding few tweaks? So here are five simple tweaks that will make your WP life a lot comfortable.

Denying access to non-referrer request/Spam-bot request via .htaccess

This is simple and straight forward way to deal your referrer spam. Well off course considering your server is Apache with mod_rewrite module installed. Since all the games played in the wp-comments-post.php file and spam-bots usually does not leave a referrer, we can detect and deny their access to wp-comments-post.php file by just using these few lines on .htaccess file (located on the root WordPress installation directory). If you don’t have any .htaccess there but your server does support one you can just create one on notepad (save as->file name- .htaccess, save as type-all files) and upload it via FTP. Don’t forget to replace *myblog.xxx.*(on line 3) with your own domain name,remember no www or http://

  1. RewriteEngine On RewriteCond %{REQUEST_METHOD}
  2. POST RewriteCond %{REQUEST_URI} .wp-comments-post\.php
  3. RewriteCond %{HTTP_REFERER} !.*myblog.xxx.*
  4. [OR] RewriteCond %{HTTP_USER_AGENT} ^$
  5. RewriteRule (.*) ^http://%{REMOTE_ADDR}/$ [R=301,L]

Custom permalinks

Undoubtedly the best one suggested by SEO’s. This tweak requires you to change the default page title from (www.yourdomaincom/?p=1) to a much SEO and user friendly www.yourdomainname.com/category/page title.

This can be done by following the two simple steps.

  1. Goto Options > Permalinks
  2. Change the default setting to custom with the following code - /%category%/%postname%/

Learn more about WordPress permalink.

Showing tag cloud (WordPress 2.3.x only)

There are quite a few plug-in out there that not only shows tag cloud but do pretty much all other things as well. But just for showing tag cloud installing/using those plug-in is redundancy, while WordPress got its own template tags to do this simply.

In simple what you have to do is just place following piece of code in your WordPress theme file (ex: Sidebar.php) where you would like the tag cloud to be shown.

  1. <?php wp_tag_cloud(''); ?>;

You can use CSS to do the styling. This template tags got some parameters that will allow you to do further customizations as well. The parameters are:

  • Smallest: (integer) The font size for the tag with the smallest count value. Remember just number no px or em here.
  • largest : (integer) The font size for the tag with the highest count. Same like previous numbers only
  • unit: (string) This is where you declare the Unit of measure of the smallest and largest font size you declared earlier. This can be- pt, px, em, %; default is pt (points).
  • number: (integer) How many tags to show in tag cloud, place 0 for all, which is default by the way.
  • format: (string) the types of the cloud display. There are three flat(default, tags are separated by white space), list (tags are separated by li), array (tags are all in an array-every tag is an element to that array).
  • orderby: (string) This is where you define how you would like to display the tags within the cloud. There are two options here name(default) or count (no. of posts have the same tag)
  • order: (string) In previous parameter you defined how, not here you define the sort order, i.e descending(DESC) or ascending(ASC).
  • exclude: (string) By default this parameter don’t hold any value. This is for excluding certain tags that you want to exclude from the cloud. Just place the term_id (Tag id) separated by commas. Include: (string) Same like above comma separated term_id, the difference is the function is just opposite.

Example usage:

  1. <?php wp_tag_cloud('smallest=7&amp;largest=25&amp;unit=pt&amp;number=20&amp;format=li&amp;orderby=count&amp;order=DESC&amp;exclude=7,5'); ?>

That’s all for the day, tune back in for more.

Leave a Comment

If you would like to make a comment, please fill out the form below.-(See Privacy Policy)

Name (required)

Email (required)

Website

Comments

3 Comments so far
  1. whOor June 22, 2008 10:11 pm

    GREAT Website, I want more updatesFeel Free To Comment Back, Thanks,

  2. Cevow June 25, 2008 2:21 am

    Is There More? I Like it,

  3. Kams(Kamrul) July 11, 2008 8:22 am

    Cevow, certainly there is–will follow couple of post soon.

Close
E-mail It