For “Related Post” or “Related articles” are a series of pluginthat are more sophisticated, but in the end they do about the same thing. Displays on a page (in a post) on the blog the titles of the articles that correspond as a subject with the article in which the listing is made. Is a useful function both for SEO as well as for user, allowing quick access to articles that are on the same subject as the one on the page on which the listing is made.
It is known as a large number of plugin-uri can inflict negative the loading time of one page and in addition it creates additional tables in the database.
A good idea would be to replace as much as possible WordPress plugins with code lines that will lead to the same result. (Attention, however, because some codes especially in functions.php can seriously affect server performance)

The plugins of “Related Posts” can be replaced with the below function, if we choose to be on the article page to be displayed the titles of articles which contain the same tags with the post in which it makes listing. Using this relationship criterion we can add the code below to the file single.php of the theme used on the blog.
<?php
$tags = wp_get_post_tags($post->ID);
if ($tags) {
$tag_ids = array();
foreach($tags as $individual_tag) $tag_ids[] = $individual_tag->term_id;
$args=array(
'tag__in' => $tag_ids,
'post__not_in' => array($post->ID),
'showposts'=>5, // Number of related posts that will be shown.
'caller_get_posts'=>1
);
$my_query = new wp_query($args);
if( $my_query->have_posts() ) {
echo '<h3>Related Posts</h3><ul>';
while ($my_query->have_posts()) {
$my_query->the_post();
?>
<li><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></li>
<?php
}
echo '</ul>';
}
}
?>Concrete example.
On the article page “WordPress Exploit - Cleaning Virus files, SQL and Server Security.” Those related to WordPress, viruses, databases, exploits are listed as related articles.

The function is tested on WordPress 3.3.1 but is also compatible on newer versions of WordPress 2.X.
Stealth Settings – Show Related Post in WordPress Without a Plugin.
 
			