Show the image attachments in Post list section

Show the image attachments count in Post list section

Many people wants to see the number of attachments which are used for posts. In Post list page people wants to see the number of image and other attachments. Using following code you will be able to see the attachment count in post list section.

You just need to copy and paste the following code into functions.php file.

add_filter('manage_posts_columns', 'posts_columns_attachment_count', 5);
add_action('manage_posts_custom_column', 'posts_custom_columns_attachment_count', 5, 2);
function posts_columns_attachment_count($defaults){
    $defaults['wps_post_attachments'] = __('Attached');
    return $defaults;
function posts_custom_columns_attachment_count($column_name, $id){
	if($column_name === 'wps_post_attachments'){
	$attachments = get_children(array('post_parent'=>$id));
	$count = count($attachments);
	if($count !=0){echo $count;}

Show the image attachments in Post list section
Ref Url:

After WP registration send user to specific page

Many wordpress website users allow user to register on there site. After new user registration if we want to show them specific instructions or registration success page then you can use the following code. Put following code into functions.php file.

Before adding the following code create your “registration-done” page.

function wpapi_registration_redirect(){
    return home_url( '/registration-done/' );
add_filter( 'registration_redirect', 'wpapi_registration_redirect' );


How to to list the all wordpress roles in selectbox

In your theme code backend or plugin code you can list your wp roles. You need to display wordpress users roles many times in theme configuration and plugins page. For fetching the wp users roles you can use the following code.


$roles_obj = new WP_Roles();
$roles_names_array = $roles_obj->get_names();
echo '<select name="role">';
foreach ($roles_names_array as $role_name) {
	echo '<option>'.$role_name.'</option>';
echo '</select>';



How to add the custom background functionality support to wordpress theme

In new wordpress version we can add the background image or color to wordpress websites. Many older wp themes has no support for custom background functionality.
You can very easily add the custom background support to your wordpress theme. You just need to copy following code and put in your functions.php file.


add_filter( 'body_class', 'wpapi_body_class' );
function wpapi_body_class( $classes ) {
	$background_color = get_background_color();
	$background_image = get_background_image();

	if ( empty( $background_image ) ) {
		if ( empty( $background_color ) )
			$classes[] = 'custom-background-empty';
		elseif ( in_array( $background_color, array( 'fff', 'ffffff' ) ) )
			$classes[] = 'custom-background-white';

	return $classes;

// Activate custom background and set callback function
if ( function_exists( 'add_theme_support' ) ) {
    $defaults = array(
    'default-color' => '000000',
    'default-image' => get_template_directory_uri() . '/img/background.png',
    'wp-head-callback' => 'my_theme_background_cb',
    'admin-head-callback'    => '',
    'admin-preview-callback' => ''
    add_theme_support( 'custom-background', $defaults );

WordPress login window are moving if we add the wrong username or password

When we try to use the wrong username or password in wp login windows. It started shaking the login window.
Some times it looks weired. Many clients wants to remove that shaking effect.

Using following easy hack we cna remove this effect. You just need to copy and paste the following code into the functions.php which you will find in your active theme folder.

function wpapis_login_error() {
        remove_action('login_head', 'wp_shake_js', 12);
add_action('login_head', 'wpapis_login_error');



10 SEO Mistakes that should be avoided in WordPress

Search Engine Optimization can help you get higher ranks on search engine pages and builds your online presence to a great extent. But going about it the wrong way can be a lot worse than doing nothing at all.


There are few mistakes that WordPress users make quite often; they are listed below so that you can ensure that you don’t fall into the same trap.

Don’t provide XML sitemap

A sitemap is an XML file, which has the lists of URLs for sites. With their help, webmasters can make it easier for search engines to crawl websites more efficiently and easily. But there are many webmasters who don’t understand the importance of XML sitemaps, which can lead to search engines ignoring pages from the site. And that naturally means the visibility of your website will be greatly reduced. As your web pages don’t get indexed by all and mighty search engines, your online visibility is bound to suffer.

Not setting up Google Authorship

Google authorship is an important element of search friendly websites today; no two ways about it. It makes a world of difference to your brand promotion because your users can see a picture next to your articles. In fact your content, irrespective of the platform, will stay connected to your name. There are many who haven’t woken up to the importance of Google Authorship and don’t set it up, which is something you need to avoid at all costs.

Not optimizing URLs for SEO

If your URL has a smart title, it can help you with search engine ranks; no two ways about it. Running a website the traditional way can make it difficult, but when you are using a CMS platform like WordPress things are made a lot easier. You can make the most out of the tools offered by the platform and have creative titles for blogs, articles to gain good results. Letting go of this opportunity is a huge mistake you cannot afford.

Improper Categorization and Tagging

If you want to keep users engaged and boost traffic to your site, you can use categorization and tagging to your advantage. Using the right categories and tags in blogs and articles will encourage readers to go through the entire website. You can overlook this opportunity at your own peril as many already have. Having your web posts without tags and categories could mean that you are losing your ranks with search engines.

Irrelevant External Links

They are as important as internal links and should be relevant, keeping your site in context. Search engines will pay attention to the links you have to other sites and compare the thematic content to ensure that there is a match. Hence it’s important to look at external links before posting because they should define you according to your vision.

Poor Quality Backlinks

Their importance cannot be overemphasized as search engines consider them closely while judging a website’s popularity and importance. It’s been seen that some bloggers use ways like buying backlinks from farms or sites that have been put up with the sole purpose of selling links. These backlinks are often of poor quality and will give a similar impression about your site to search engines. On the other hand few backlinks from authoritative websites are worth their weight in gold.

Not updating WordPress

Your whole WordPress website will have to be updated at certain times and you can benefit from features like enhanced security, fixes etc. It’s incredible to see many not updating their sites and thus running the risk of being vulnerable or stuck with a website that doesn’t function optimally. It’s criminal to let that happen, especially since a single click of a button is all it takes to update your website.

Not installing any WordPress SEO plugin

Surprisingly, this is another common mistake that is made by many WordPress users. There are several plugins like Inbound Writer, Scribe, WordPress SEO by Yoast, All in One SEO, which have their tremendous advantages for your site’s optimization. Each of these plugins however performs differently, and thus has to be chosen wisely based on your requirements.

Poor On Page SEO

If you don’t organize your page or post around a certain keyword so that it’s spotted by search, then it can be a huge mistake. According to many, it is one of the major factors of WordPress SEO. If you make a mistake here, chances are that all your other good work will come undone. Thankfully there are plugins you can choose to help you with this element.

Keyword Stuffing

Importance of keywords for search engine optimization is now well understood. But you also need to understand that keyword stuffing is considered to be an unethical search engine optimization practise. It could lead to a temporary or a permanent ban on your website.

If you wish to rank for a certain category of keywords then you can create a separate page for it and then optimize it. You can also avoid duplicating keywords and create pages with them built in as a part of the content instead. You will benefit from that immensely because having high quality and relevant content on your website is quite good for the ranking of your website. However make sure you stay away from keyword stuffing at any cost because it will only hurt your chances with search engines.

These are some of the common WordPress SEO mistakes that you can easily avoid and ensure that you are getting maximum benefits for your website.


Add custom text or change the wordpress dashboard help section

WordPress is most popular cms these days and many companies are working on wp development. Many times they wanted to add or build custom help section for there clients. In wordpress admin section in the top-right corner. you are able to see the help drop down. If you click on help button then it will open the help section. You can modify or customize the help section as per your need.

You can just use the following code to customize the help section. You need to copy and paste the following code into functions.php file. which you will find in active wp theme directory.


//hook loading of new page and edit page screens

function add_custom_help_page() {
   //the contextual help filter

function custom_page_help($help) {
   //keep the existing help copy
   echo $help;
   //add some new copy
   echo "<h5>Custom Features</h5>";
   echo "<p>You can add your custom text over here. It will apprear in help section.</p>";

If you have any further doubts or questions then you can write to me.


Best Captcha Plugins for WordPress: Review

What is CAPTCHA?
First of all let’s consider what Google search says about definition of this word.
CAPTCHA is a program or system intended to distinguish human from machine input, typically as a way of thwarting spam and automated extraction of data from websites causing them to pass a reverse Turing test. Typically, the user is prompted to enter expression of numbers and letters of the different register into a form field which is shown in automatically generated picture.
Nowadays there are a lot of Captcha plugins for WordPress with the most unbelievable solutions for your website. You can check it by yourself in WordPress plugin search.Today we will consider four most popular instruments of this category. They have different conceptual views, but are directed initially on performance of the same function.
Each plugin has a number of advantages and disadvantages.

Really Simple CAPTCHA

Really Simple Captcha

This plugin is a CAPTCHA module intended to be called from other plugins. It is originally created for Contact Form 7 plugin.

Advantagesof this plugin:

  • Functions well. A big barrier for robots and fights spam.
  • Integration instructions are clear and simple.
  • CAPTCHA is actually quite readable and not unintelligible, distorted gibberish that could turn away users!


  • Incomplete plugin without translations into different languages.
  • Works only with Contact Form 7. Really Simple CAPTCHA does not work alone and is intended to work with other plugins. It is originally created for Contact Form7.

Really Simple Captcha 2

What can we say about this Captcha? It is a very simple and understandable Captcha for users. But this simplicity does not fulfill the basic functions of security. When you generate a CAPTCHA, Really Simple CAPTCHA creates two files for it; one is an image file of CAPTCHA, and the other is a text file which stores the correct answer to the CAPTCHA.
It is a very good and simple solution but not so safe. First of all it is not so safe for your hosting and site. Because this two files that created in temporary folder have a size of some kilobytes. Sure you can say “What a problem?” Yes it is not a problem. But when your website will visit and use this captcha a lot of people (for example 1000 or more) it become a problem for your hosting. So make your own conclusions …


This plugin adds CAPTCHA anti-spam methods to WordPress on the forms for comments, registration, lost password, login, or all. For WP, WPMU, and BuddyPress.

Si Captcha Anti Spam
Advantages of this plugin:

  • It is a small, unobtrusive and simple plugin.
  • It is easily installed and configured.
  • Displays well on mobile and tablet devices.
  • Works smoothly on all WordPress updates.
  • This plugin doesn’t scam you for your e-mail by demanding registration, additional library downloads and other nonsense.
  • Refresh button to reload captcha if you cannot read it.


  • As users said “This plugin does not prevent full SPAM user registrations and spam comments”.
  • This plugin is very colorful and unclear. So colorblind people can’t see some colors and read correctly a letter or symbol.

Si Captcha Anti Spam 2

I think that disadvantages are much stronger than advantages of this plugin. Unfortunately, this plugin does not stop the spam registrations as its description suggests. Users of this plugin said that when you install this plugin on your website you will still get about half a dozen spam comments and spam registrations a day.
Either there are smart bots and the captcha isn’t hard enough, or spammers have an easy way to get humans to complete these captchas en masse… We don`t know!
I think that this Captcha is outdated and does not perform all of its functions well. Because spammers do not sit still and they looking for new ways of their spam attacks.
And also I think that colorful letters are not an excellent solution for Captcha plugin, because the developer did not take into account the colorblind people, who can not distinguish colors.

Confident CAPTCHA

Confident CAPTCHA is a clickable, picture CAPTCHA that stops spam and malicious bots, while remaining a very easy CAPTCHA for humans to solve.

Confident Captcha
Advantages of this plugin:

  • Picture-based CAPTCHA, easy to use and install.
  • Mobile-optimized CAPTCHA version available.
  • Photos are much easier/friendlier than trying to read a badly distorted text.
  • CAPTCHA audio option.
  • Confident CAPTCHA is available in several languages.
  • You can match the captcha skin to the color of your website.


  • It doesn’t work with WP Multisite.
  • It looks like an advertisement.
  • Distracts from content of the website.

Confident Captcha 2

This Captcha has both positive and negative features. It is a very interesting solution. This Captcha can make your website more colorful. You can easily change the color of Confident CAPTCHA by selecting one of the several options for CAPTCHA Color on the settings page. This way Confident CAPTCHA will look great regardless of where you place it. But also the main drawback of this plugin is that it looks like an advertisement at the bottom of your comment box asking people to click it before they can post, and there is no Setting to add user-definable informative text just above the Captcha like “Prove you are a human by clicking the photos below.”
I think that this Captcha is not for serious projects and websites, because when your site is replete with a huge number of colorful pictures it can carry a negative point for your visitors.


This plugin allows you to implement a super security captcha form into web forms by means of math logic.

Captcha 1

Advantages of this plugin:

  • You can use letters and numbers in captcha or just one of these two things – either letters or numbers.
  • The basic math actions are used – add, subtract, multiply.
  • Captcha by BestWebSoft is available in 36 languages.
  • It is very easy to use and install.
  • Simple and usable.
  • Only math logic. You will not have to spend your precious time on annoying attempts to understand hard-to-read words, combinations of letters or pictures that make your eyes pop up.
  • Full compatibility with Contact Form.
  • PRO version with compatibility of Contact Form 7 and BuddyPress (registration form, comments, group creation)
  • There is detailed documentation, step by step video instructions of configuration and installation and also text instructions with screenshots.
  • A function of paid customization.


  • Free version is not compatible with BuddyPress. You have to get the premium version of the plugin, allowing compatibility with BuddyPress (Registration form, Comments form, “Create a Group” form) and Contact Form 7.
  • Priority technical support and guaranteed response during the day is only available when purchasing Captcha PRO. Requests from users of the free version can be considered up to five days.
  • Every 6 months, you must renew the license of the product. If you do not renew your license, you can continue to use the PRO version, but you will no longer be available have a priority technical support and future product upgrades.

Captcha 2

As for Captcha by BestWebSoft it is the best solution to the problem of bot attacks. Simple maths is a brilliant idea! It is very easy to use and doesn’t make your eyes pop out. Also Captcha can be installed with no problems at all, easy to configure, allows customizing the header.


We’ve reviewed the main features of these plugins. All of them have been created for one mission – to implement super security to your website and to stop spam and malicious bots.
So after reviewing all the plugins we can make a conclusion that the easiest, most useful and powerful plugin is Captcha by BestWebSoft. Other plugins are great too but they have a lot of disadvantages. Pictures, letters, codes are not so useful and functional as simple maths. Personally,  I hate guessing squiggly images or guessing words to prove I’m human, it hurts my eyes and takes too long, so simple maths is an amazing solution to the problem of spam and bot attacks.
This plugin is great because it has a simple method of work. It protects your website from spam by means of math logic, easily understood by human beings. You will not have to spend your precious time on annoying attempts to understand hard-to-read words, combinations of letters or pictures that make your eyes pop up. All you need is to do one of the three basic maths actions – add, subtract and multiply. This captcha can be used for login, registration, password recovery, comments forms.
Another important factor is the rating of these plugins on the official site we can see that Really Simple CAPTCHA has rating 4.4 out of 5 stars. SI CAPTCHA Anti-Spam has 3.9 out of 5 stars. Confident CAPTCHA has 4.3. And Captcha by BestWebSoft has rating 4.6 out of 5 stars. There is nothing more to add, make a conclusion by yourself.


How to clean wordpress by deleting the revisions automatically

Many times people use the the plugin for deleting the post revisions. There are so many plugins are available for deleting the post revisions. Deleting by revisions perform optimizations on your WordPress database action. Removing old revisions and database optimizations is one of the best things you can do to your WordPress blog to keep it running as fast as it can.  Here in this article I will show you how to delete the post revisions automatically.

What you need is you need to put following code in functions.php file.

$wpdb->query( "
DELETE FROM $wpdb->posts
WHERE post_type = 'revision'
" );

Here are some plugins which are helpful for cleaning the database and delete the revisions.

Better Delete Revision

Better Delete Revision not only deletes redundant revisions of posts from your WordPress Database, it also deletes other database content related to each revision such meta information, tags, relationships, and more. Better Delete Revision is based on the old “Delete Revision” plugin but it is compatible with the latest version of WordPress (3.x) with improved features.

Your current published, scheduled, and draft posts are never touched by this plugin!

This plugin can also perform optimizations on your WordPress database. With optimization and old revision removal this plugin will keep your database lighter and smaller throughout use. Removing old revisions and database optimizations is one of the best things you can do to your WordPress blog to keep it running as fast as it can.

WordPress MU or customs installation (like some pre-made installation of some Hosting Providers) are not yet supported. WordPress MU support is in our TODO list.

Post Revisions are a feature introduced in WordPress 2.6. Whenever you or WordPress saves a post or a page, a revision is automatically created and stored in your WordPress database. Each additional revision will slowly increase the size of your database. If you save a post or page multiple times, your number of revisions will greatly increase overtime. For example, if you have 100 posts and each post has 10 revisions you could be storing up to 1,000 copies of older data! The Better Delete Revision plugin is your #1 choice to quickly and easily removing revision from your WordPress database. Try it out today to see what a lighter and smaller WordPress database can do for you!




WP-Optimize is a WordPress 3.xx database cleanup and optimization tool. It doesn’t require PhpMyAdmin to optimize your database tables.

It allows you to remove post revisions, comments in the spam queue, un-approved comments, items in trash within few clicks.

TW Disable Revisions

This plugin will disable revision function in WordPress and delete all entries of revisions in database.

It is extremely important to back up your database before install this plugin if you want to keep backup of your revisions.


Bulk Delete

Bulk Delete is a WordPress Plugin which can be used to delete posts in bulk from selected categories, tags, post types or custom taxonomies. This Plugin can also delete all drafts, post revisions, scheduled posts or pages and users based on user role.

Bulk delete users based on user role and posts from selected categories, tags, post types, custom taxonomies or by post status like drafts, scheduled



On Page WordPress SEO with All In One SEO Pack

Are you like me? Do you have strong content writing and blog promoting abilities, but lack the knowledge of how to actually build a WordPress site? You probably can figure out how to install the blog but that’s about as far as you can go. If you’re just going to write a personal blog or one for fun, you’re probably a single person operation. You can get up and running, but that’s about it.


Luckily for us marketers, there’s an easy to install plugin called All In One SEO Pack that helps us do what we do best; optimize our articles for search engines. Just follow these 4 steps to add the plugin to your WordPress install:

How To Get Started

  1. Log into your WordPress site
  2. Click the Plugins link and click Add New
  3. Search “All in One SEO Pack,” click install and confirm
  4. Activate the plugin

If you’ve spent any time on internet marketing forums, you’re bound to come across a poster who wants to know how to get hundreds of back links to their WordPress site, but they’ve made no effort to optimize their own content. The All in One SEO Pack now makes it as easy as ever to optimize your on page SEO. You’ll now find boxes when publishing posts allowing you to specify the post title, description and keywords.


  • Title

The meta title is probably the most important on page SEO element. Your title is the link text that will show up in Google’s organic rankings. Make sure to write a highly relevant title. You’ll want to make sure your post’s intended keyword is included in the title, but don’t just cram your title with keywords. Remember that you’re writing for your audience, not Google, so the title should be interesting and eye catching. You have about 60 characters to work with, but each word is generally weighted roughly the same so be frugal with your words. It’s also a good idea to put your most important keywords farthest left on your title.

  • Description

Google doesn’t use the meta description in their rankings, but this is another opportunity to help make your listing stand out in their listings. After all, this is the 150 character text that will show up below your link (though there isn’t a guarantee that Google will use your meta description at all).

  • Keywords

Like the meta description, Google doesn’t use meta keywords in their rankings. You’ll probably want to throw a keyword in or two for the smaller search engines. It can’t hurt and only takes a few seconds to add them.




Us marketers may not necessarily know how to build a WordPress site, but with plugins like the All in One SEO Pack, we sure can make our sites attractive to search engines!