You are here: Home » WordPress » 5 Powerful WordPress Hacks to Improve SEO Ranking

5 Powerful WordPress Hacks to Improve SEO Ranking

Traffic is all about SEO Optimizing and Rankings. This post includes the most powerful wordpress hacks which will help you gaining top positions in Search Engines and Improve SEO Rankings. WordPress is already 60% SEO optimized CMS but when it comes to rankings, then you need to do external mindsets for ranking on the top in the Search Engines.

These WordPress Snippets, Tricks are must for every WordPress user, if you want to rank better. These snippets helps Search Engine bots, like Google bots to identify your content well and crawl the pages faster with effectiveness. What we will be doing to improve SEO is just editing some files, mainly the most powerful file .htaccess to get the most out of your blog. So, lets get started.

WordPress Hacks to Improve SEO

5 Powerful WordPress Hacks to Improve SEO Ranking

Redirect 404 Pages

< IfModule mod_alias.c >
RedirectMatch 301 ^/search/$ http://your-site.com/
RedirectMatch 301 ^/tag/$ http://your-site.com/
RedirectMatch 301 ^/category/$ http://your-site.com/
< /IfModule >

404 Error Pages are those Pages which are generated when there is no content on the page you have specified. The bad part of 404 pages is that, 404 Pages decreases the Pagerank of your blog making your site rankings ineffective. So, what we will be doing to Improve SEO is utilizing the WordPress Hack to redirect the 404 Error Pages to the Blog’s Homepage.

Automatically Remove Stop Words from URL

add_filter('sanitize_title', 'remove_short_words');
function remove_short_words($slug) {
if (!is_admin()) return $slug;
$slug = explode('-', $slug);
foreach ($slug as $k => $word) {
if (strlen($word) < 3) {
unset($slug[$k]);
}
}
return implode('-', $slug);
}

When you write a title for your blog post in WordPress, the permalink adjusts according to the title you wrote. It is considered that we should not use Stop Words like, for, the,is etc in the permalinks of blog posts. It improves SEO and also helps to expect the content from the URL only. So, to make the job automatically done, use the snippet to automatically remove stop words from permalink to Improve SEO.

Highlight Keywords in Search Results

function wps_highlight_results($text){
if(is_search()){
$sr = get_query_var('s');
$keys = explode(" ",$sr);
$text = preg_replace('/('.implode('|', $keys) .')/iu', '<strong>'.$sr.'</strong>', $text);
}
return $text;
}
add_filter('the_excerpt', 'wps_highlight_results');
add_filter('the_title', 'wps_highlight_results');

Use this snippet to highlight the Searched Words in the_excerpt and the_title of the searched results on your blog.

Rewrite Search Result Permalinks

function search_url_rewrite_rule() {
if ( is_search() && !empty($_GET['s'])) {
wp_redirect(home_url("/search/") . urlencode(get_query_var('s')));
exit();
}
}
add_action('template_redirect', 'search_url_rewrite_rule');

This snippet helps you to rewrite the Search Results Permalink like “yourblog.com/search/searched-keyword“, ultimately its better than the default search permalinks, hence improves SEO.

Disallow Directories for Google Bots

User-agent: Googlebot
Allow: /?display=wide
Disallow: /wp-content/
Disallow: /trackback/
Disallow: /wp-admin/
Disallow: /feed/
Disallow: /index.php
Disallow: /*?
Disallow: /*.js$
Disallow: /*.inc$
Disallow: /*.css$
Disallow: */feed/
Disallow: */trackback/
Disallow: /link.php
Disallow: /gallery2
Disallow: /gallery2/
Disallow: /refer/
User-agent: Googlebot-Image
Disallow: /wp-includes/
User-agent: Mediapartners-Google*
Disallow:

Use this piece of snippet in your robots,txt file to prevent Gogole Bots to index undesired directories like wp-content, wp-includes etc.

Visit Author's Website

We have a team of experts in graphics related stuff, who bought this article up-to you.

21 Comments

  1. To be honestly I haven’t optimized my blog for 404 pages error.Now I’m going to optimize 404 error pages in my blog :) Thanks for this technique.

    • Yup, you should. Its most important to hide the 404 pages from Google.

  2. Another trick …Make quality articles for readers not for Search Engines

  3. hello,

    did i miss where i should add these codes?

    sorry for that basic question!

    thanks again

    • I should have mentioned, though first and last to be put in .htaccess file and rest to be in functions.php

      • Do 404 pages create problem? I have over 1000s of 404 pages. I fear that 1000s of 301 redirect may hurt my ranking. Do you have any solution for such problem?

        • The definitely Create Problem, and Google takes them as a Low Quality Content Page which is a error page for you. Solution of it is already described,redirection.

          • But if you are ranking well, then you can ignore the step.

  4. Hi DesignSkew.com,
    Thank you for this very useful information, and for share it!
    I have a very basic question as well. Where exactly do i have to put the snippets? You say in htaccess file and rest to be in functions.php, but “where exactly”, after what?
    Sorry for my low level, and thank you again for this wonderful article. ;-)

    • Its fine, I feel good to help newbies, exactly I can’t tell because it is different for different theme. But in most condition, you can try adding the snippets in the bottom of the functions.php file, and same for htaccess, in the bottom of the file.

      Also, don’t forget not to leave any blank line in the end of functions.php file.

      • Thank you very very very much! ;)

  5. Thanks for these hacks! I’m gonna use the Search Results hacks on my sites :)

  6. thanks for your bunderful artical and unique contents these are very usefull

  7. Nice coding *hacks* Thanks for the update! :)
    Keep up the good work Buddy!

  8. Great tips here. This is exactly bloggers like me should learn how to code – it puts them in a position where they can optimize not only on-page, but also site elements and functions for better user experience. Oh, the envy!
    Chris recently posted..How a Bipolar Artist Overcame Her Disabilities and Found SuccessMy Profile

  9. Well,
    Hacking is not a easy task so I appreciate the work you describe in this post.

  10. Great idea but confusion because hacking is not a simple task and I would like to give it a try if you help me for one of my website. Will I send my website access to you??
    Opu recently posted..The Different Ways to Increase Website TrafficMy Profile

  11. Hi!

    Your website is way too good. I enjoy the valuable data you deliver to your posts. I will save your blog page and look all over again in this article routinely.
    Also i hope your post will help me improve my website.

  12. Hey Mani,
    Modifying robots.txt file and disallowing affiliate links as well as directory would help us to get quick ranking.Premalink is also important, however during recent Google algorithm updates, I am using harsh agrawal’s tips of removing dates from blogpost will also be helpful for SEO.

    I have personally experienced it and removed dates from one of my blog to test the results. It helped me to recover 20% of my lost traffic and still I am trying new stuffs to recover my lost traffic on my blog.

    Thanks for the great article.
    Bhavesh Sondagar recently posted..How to Perform SEO Audit Using SEMrush SEO ToolMy Profile

  13. Hi Mani,

    Custom 404 page is a must for every blog, having a custom 404 pages reduced your bounce rate, improve your SEO.

    I’m sure it’s going to be very helpful.

    Thanks for sharing
    Chiastine recently posted..What Should be on Your Website’s 404 Page?My Profile

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

CommentLuv badge
This blog uses premium CommentLuv which allows you to put your keywords with your name if you have had 5 approved comments. Use your Real Name and then @ your keywords (maximum of 3)