Related post plugin of WordPress : How to install it by running a SQL query

Related post plugin has been one of the most useful and highly recommended plugin which helps increase the visibility of your posts by showing a list of posts related to the current post. It’s a very helpful way to showcase your earlier work in a blogging environment where the older posts get buried deeply easily.

However, many people face difficulty in installing this plugin. The normal method of installing a plugin in WordPress (WP) is to upload the plugin in the Plugin directory and then activate it through Dashboard. However, apart from this procedure, the ‘Related Post’ plugin also require you to first run a script so that it can index all the posts in your blog. And here lies the problem.

Many people have faced this problem that when they click on run the script (in the Related post option), they got an error message that says:

“Sorry, you must be at least a level 8 users.”

error1.jpg
Actually this message is an indication that you need to manually run a SQL query in your WordPress database. The ‘Read Me’ file of this plugin also says :

“If automatic creation of a full text index fails. You will have to set it up manually. Don’t worry it’s not hard. Just open your database in phpMySQLadmin and run the following command (cut & paste):

ALTER TABLE `wp_posts` ADD FULLTEXT `post_related` (
`post_name` ,
`post_content`
)”

The problem is that most users (included me  ) who are not familiar with SQL or programming etc find it difficult to do this on their own. So here is my tutorial to guide you step-by-step how to run this command.

What we will do ?

Every WordPress blog is powered by a database, which runs in the background. We need to make some modification in that database manually to properly install the plugin. We shall do it by identify the database on which our WP blog is running and then modifying a Table (‘wp_posts’) in that database.

I am assuming you that you are using Cpanel to manage your website and have installed WP using fantastico script (i.e. point and click installation). I have used the acronym WP for WordPress on many places in this tutorial. Please click on the screenshot for full view.

First Step : Identify the Database

If you are only running a WordPress blog and there is no other program/script (which uses database) is installed on your site then it’ll be easy. However, if some other programs (such as link-exchange script, forums etc which also run on databses) are installed on your website, then you’ll have to find the database used by your WP blog. For this login to site/blog using your ftp client and go the the root folder of your blog (i.e. the folder where your WP blog is installed). Here you’ll find a file named ‘wp-config.php’.

ftp21.jpg

Download this file to your hard disk and open it in Notepad. There will be some configuration settings in this file. On the third line you will find the name of the database of your WP blog. Look at the screenshot. In the screen shot the name of the database is : medita00_wrp4.

notepad3.jpg

You’ll need to modify this database of your WP blog. Note the name of this database carefully.

Now we’ll start the modification process. Login into the control panel of your Website. If it’s an old version of Cpanel it’ll look like this :
cpanel_old4.jpg

Here you need to click on the icon which says MySQL Databases.

In the new version of Cpanel all icons are separated category-wise and the Mysql database icon will look like this :

newcpanelfp4.jpg

If you have the new Cpanel (as shown in the above screenshot) then instead of clicking on ‘MySQL Databases icon, you can directly click on ‘phpMyAdmin’ icon.

In the old version of Cpanel, we can’t access phpMyadmin directly. Here on clicking the ‘MySQL Databases’ icon, you’ll get following screen :

old_cp-uppage5.jpg

At the end of this screen, you’ll get a link for accessing the PhpMyadmin like this :

old_phpmyadmin6.jpg

Click on this link.

So, the above are two methods to access PhpMyadmin section of your databases.

Let’s start running the Query

On clicking on phpMyadmin (in either of the new/old Cpanel) you’ll reach at the phpMyAdmin screen. On this screen in the leftmost sidebar, you will see a list of all the databases installed in your website. If your site has only one database then only one database will be listed. In the above example the name of the database was medita00_wrp4. As you can see in the screenshot, the medita00 is the name of the extension which is prefixed at the name of every database (like medita00_wrp4) and therefore is shown in the top of the list. The database which we are looking for is listed at the end of the list. Click on that database. See the screenshot

phpmyadmin7.jpg

On clicking the database (‘wrdp4’ in this case), the following screen will appear.

phpmyadminfpx02.jpg

This is the place where we need to run a query. Please note that in the list of tables a table named wp_posts exists. In 99.99% of cases it’ll be there. I am yet to see a WP installation where this table is not present. We are actually altering this table to include an entry for relatedpost plugin.

Click on the button which says SQL . The SQL tab will open like this :

phpmyadminfpx03.jpg

Here copy and paste the code for ‘Related post’ as given in the Readme file of the plugin.

Click on Go. phpmyadminfp11.jpg

The query will be executed and you will get the following message.

phpmyadminfp12.jpg

Congratulation ! you have installed the Related posts plugin successfully. Now you can use this plugin by inserting the code ( <?php related_posts(); ?> ) somewhere in your WP loop) at any place of your template pages (like single.php). It’ll work.

Please note that despite running this query, you’ll still get the error (of level 8 user) when you click on ‘Run the script’ in the Related post option page. Just ignore it. The plugin will run smoothly despite that error message. Actually this error message says that you can’t create the index automatically and you need to run the query manually (which you have already done). So ignore that message.

One more thing which I have observed is that this error (of level 8 users) is coming in those cases where the newer version of this plugin (2.02-404) is being used. This error does not come if you use an old version of this plugin (2.02). Using this older version, there will be no error and the script will run smoothly when you run it.

fulltextindex.jpg

It means you’ll not required to run the SQL query. You may try the older version if you want. The developer of this plugin has either closed his website or has shifted somewhere else. So here is the old version of this plugin for you to download.

Related post plugin the older version.

I hope you liked the tutorial. Your feedback on it is welcome 🙂

, , , , , ,

8 Responses to Related post plugin of WordPress : How to install it by running a SQL query

  1. Zhu Jan 5, 2008 at 1:21 am #

    Thank you so much for this tutorial. I had been trying to install this plugin for like three months (well, I did other stuffs in between :lol:) and I finally got it.

    Many thanks! Very clear and helpful tutorial, best I could find.

  2. Eklavya Jan 5, 2008 at 8:47 am #

    Thanks Zhu ! I am glad that this tutorial helped you 🙂

  3. online making money Apr 7, 2008 at 3:25 pm #

    Thanks for ur nice sharig,
    ur post are very helpful for me

  4. sirshatterstar Jul 9, 2008 at 9:10 pm #

    Thank you very much for this tutorial. Been looking for this for some time now. Thank you again!

  5. Yin Teing Sep 20, 2008 at 8:27 am #

    Thank you so much. I have searched the web for help and finally, I managed to add with your tutorial. Funny though that all my related posts become ‘random posts’ because WP cannot find any related posts.

  6. B-Double Jan 22, 2009 at 3:25 pm #

    Well done. There is no way I would of been able to do this myself. Very easy to understand. Thanks so much.

Trackbacks/Pingbacks

  1. Health And Fitness Megasite » Related post plugin of Wordpress : How to install it by running a … - Oct 13, 2007

    […] unknown wrote an interesting post today onHere’s a quick excerptHowever, apart from this procedure, the ‘Related Post’ plugin also require you to first run a script so that it can index all the posts in your blog. And here lies the problem. Many people have faced this problem that when they click on … […]

  2. You’ve Left Comments, Now I’ll Link Back « Karen Zara Dwells Here - Nov 3, 2007

    […] Related post plugin of WordPress : How to install it by running a SQL query – An in-depth tutorial that may help even those not so savvy bloggers. […]

A MIE Digital's Product