7 WordPress functions.php Codes For Better Page Speed & SEO

WordPress is the most popular and effective CMS. I love WordPress and want explore every bit of it. Recently WordPress has released its new update named by Parkar. Its really awesome. You can customize your WordPress blog easily by custom.css. Add more functionality and make it better for search engine, create more SEO friendly website with functions.php. Today I will show you how to rank better in Search Engine by adding some code in your functions.php. The most affordable seo service with minimum cost is to edit your functions.php codes. It is a guaranteed seo services. Many blogger put so much time in wordpress design, that they forget the core seo.

Caution: Always take a backup before editing the core file such as functions.php or style.css. Use FTP Client like filezilla. Any mistake even a single word will break your site and you will be not be able to access the site, not even to correct this. So if you dont have access to cpanel, do with caution.

7 WordPress functions.php Codes For Better Page Speed & SEO
7 WordPress functions.php Codes For Better Page Speed & SEO

#1. Minimum Comment Limit In WordPress

With this codes you set a minimum word count in comment. Comment with less than this count will get a error message. Comment section is very important for any website. It adds much discussion. Sometimes it has much more information than the blog post.  Some people adds comment like “nice post”, “thanks”, “good well written” etc in the comment. Actually it has no value. So you can put a comment count. Add the below code in your functions.php

#2. Add rel=”nofollow” To WordPress Comment Reply Links

Below is a WordPress snippet to add to your functions.php file to add a rel=”nofollow”attribute to your comment reply links.

#3. Show Top Commenters On WordPress Blog

Sometimes you may want to promote the top commenters. This code will do this for you. You need to add the code in functions.php

#4. Add Missing Alt Tags To WordPress Images

Sometimes you may miss to add alt tags in image. But you know how important it is for SEO. Really you need to do this. So what will you do now? Open the media folder and search for images missing alt tags? Thats a tough and really worst time killing thing. Here is the solution. Add the code in your functions.php. This code snippets will search for image that missing alt tags. Then it will add the alt tags from the title.

#5. Remove Stop Words from URL

This functions is enabled in Yoast SEO Plugin. And I like this feature. Why is that? Most search engines do not consider extremely common words in order to speed up search results or to save disk space. These filtered words are known as “Stop Words”. a, and, how, is, thanks, I,make, all, want, in, it, back etc. here is a full list of stop words. If you are using Yoast WordPress SEO plugin, you dont need this. Let me ask you one question. Why are’nt you using Yoast WordPress SEO plugin yet?

#6. Stop Search Engines From Indexing Search Results

Search results may be indexed by search engine. But it really never exits in your site. Having these indexed might create duplicate entries in the search engines compared to your category or archive pages. Here is a quick WordPress snippet to stop the search engines from indexing these pages, add the following into the head tag of theme.

#7. Add Custom Content After All WordPress Posts

Want to some messages after all post. Here is the code to do that. It can also done by custoom hooks in genesis or thesis theme. If ypui dont have them, here is the solution.

Thanks and that’s all. If you have any problem,. let me know.

Check Also

How To Add Floating Social Share Buttons In Blogspot WordPress Site

Social media is one of the best way to earn more visitor to your site …


  1. Some functions are already added if you use yoast, isnt it?

Leave a Reply

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