How to know That Your WordPress Site is Hacked

1.Sudden Drop in Website Traffic

If you look at your Google Analytics reports and see a sudden drop in traffic, then this could be a sign that your WordPress site is hacked.

There are many malware and trojans out there that hijack your website’s traffic and redirect it to spammy websites. Some of them don’t redirect logged in users which allows them to go unnoticed for a while.

Another reason for the sudden drop in traffic is Google’s safe browsing tool, which might be showing warnings to users regarding your website.
Each week, Google blacklists around 20,000 websites for malware and around 50,000 for phishing. That’s why every blogger and business owner needs to pay serious attention to their WordPress security.

You can check your website using the Google’s safe browsing tool to see your safety report.

2. Bad Links Added to Your Website

One of the most common signs among hacked WordPress sites is data injection. Hackers create a backdoor on your WordPress site which gives them access to modify your WordPress files and database.

Some of these hacks add links to spammy websites. Usually these links are added to the footer of your website, but they really could be any where. Deleting the links will not guarantee that they will not come back.

You will need to find and fix the backdoor used to inject this data into your website. See our guide on how to find and fix a backdoor in a hacked WordPress site.

3. Your Site’s Homepage is Defaced

This is probably the most obvious one as it is clearly visible on the homepage of your website. Most hacking attempts do not deface your site’s home page because they want to remain unnoticed for as long as possible.

However, some hackers may deface your website to announce that it has been hacked. Such hackers usually replace your homepage with their own message. Some hackers may even try to extort money from site owners.

4. You are Unable to Login to WordPress

If you are unable to login to your WordPress site, then there is a chance that hackers may have deleted your admin account from WordPress.

Since the account doesn’t exist, you would not be able to reset your password from the login page. There are other ways to add an admin account using phpMyAdmin or via FTP. However, your site will remain unsafe until you figure out how a hacker got into your website.

5. Suspicious User Accounts in WordPress

If your site is open to user registration, and you are not using any spam registration protection, then spam user accounts are just common spam that you can simply delete.

However, if you don’t remember allowing user registration and notice new user accounts in WordPress, then your site is probably hacked.

Usually the suspicious account will have administrator user role, and in some cases you may not be able to delete it from your WordPress admin area.

6. Unknown Files and Scripts on Your Server

If you’re using a site scanner plugin like Sucuri, then it will alert you when it finds an unknown file or script on your server.

You need to connect to your WordPress site using a FTP client. The most common place where you will find malicious files and scripts is the /wp-content/ folder.

Usually, these files are named like WordPress files to hide in plain sight. Deleting these files immediately will not guarantee that these files will not return. You will need to audit the security of your website specially file and directory structure.

7. Your Website is Often Slow or Unresponsive

All websites on internet can become victims of random denial of service attacks. These attacks use several hacked computers and servers from all over the world using fake ips. Sometimes they are just sending too many requests to your server, other times they are actively trying to break into your website.

Any such activity will make your website slow, unresponsive, and unavailable. You will need to check your server logs to see which ips are making too many requests and block them.

It is also possible that your WordPress site is just slow and not hacked. In that case, you need to follow our guide to boost WordPress speed and performance.

8. Unusual Activity in Server Logs

Server logs are plain text files stored on your web server. These files keep record of all errors occurring on your server as well as all your internet traffic.

You can access them from your WordPress hosting account’s cPanel dashboard under statistics.

These server logs can help you understand what’s going on when your WordPress site is under attack. They also contain all the ip addresses used to access your website which allows you to block suspicious ip addresses.

9. Failure to Send or Receive WordPress Emails

Hacked servers are commonly used for spam. Most WordPress hostingcompanies offer free email accounts with your hosting. Many WordPress site owners use their host’s mail servers to send WordPress emails.

If you are unable to send or recieve WordPress emails, then there is a chance that your mail server is hacked to send spam emails.

10. Suspicious Scheduled Tasks

Web servers allow users to set up cron jobs. These are scheduled tasks that you can add to your server. WordPress itself uses cron to setup scheduled tasks like publishing scheduled posts, deleting old comments from trash, and so on.

A hacker can exploit cron to run scheduled tasks on your server without you knowing it.

11. Hijacked Search Results

If the search results from your website show incorrect title or meta description, then this is a sign that your WordPress site is hacked.

Looking at your WordPress site, you will still see the correct title and description. The hacker has again exploited a backdoor to inject malicious code which modifies your site data in a way that it is visible only to search engines.

12. Popups or Pop Under Ads on Your Website

These types of hacks are trying to make money by hijacking your website’s traffic and showing them their own spam ads for illegal websites. These popups do not appear for logged in visitors or visitors accessing a website directly.

They only appear to the users visiting from search engines. Pop under ads open in new window and remain unnoticeable by users.

4 Reasons Why Java is Still #1

It’s the end of 2016, which means that we’ve now finished the “20 Years of Java” celebrations. Actually, although the announcement about Java (and the HotJava browser, which did not enjoy quite the same success) was made publicly on May 23rd, 1995, the first official release of the JDK was on January 23rd, 1996. You could justifiably claim that Java is only now turning twenty. There have been numerous retrospectives on Java, but I thought what would be interesting to look at is the success of Java in its twentieth year.

It’s difficult to accurately measure the popularity of programming languages, but one of the generally accepted surveys is the TIOBE index. This tracks language references through a variety of search engines as well as Google Blogs, Wikipedia and even YouTube. (In writing this entry I learnt something new, which is that TIOBE is actually an acronym for “The Importance Of Being Ernest,” the play by Oscar Wilde. Not sure what that has to do with programming languages, but there you go.).

Looking back at the results over the last fifteen years Java has consistently been either number one or two. Java has jostled for position with C, which was consistently the most popular before Java was launched (how things change: back in 1986 Lisp was number two and Ada was number three). TIOBE have also just announced that Java is their “Programming Language of the Year” for 2015. A great achievement, especially as it was also given the award ten years ago.

As another measure of popularity, Oracle frequently likes to quote the statistic that there are nine million Java developers in the world. If you want a chuckle check out this JAXenter article, which gives some details of how they got to this number. Regardless of the details I think we can all agree there are literally millions of Java developers around the world.

The question to ask is why does Java continue to be so popular? I think there are a number of reasons for this; let’s just highlight four:

1. Practicality
James Gosling has described Java as a “blue collar” programming language. It was designed to allow developers to get their job done with the minimum of fuss, whilst still enabling developers to pick up someone else’s (or even their own) code at a later date and understand what it’s supposed to do. Sure, you can write unreadable code in Java, just as you can in any language, but with good coding conventions it is more readable than many other languages.

2. Backwards compatibility
Sun and subsequently Oracle have made huge efforts to ensure that code written for one version of Java will continue to run unchanged on newer versions. Although this hasn’t always been the case (assertions in Java SE 1.4, enumerations in Java SE 5) and it has sometimes led to implementations that could have been better without compatibility (generics) it is a very compelling feature for developers. There’s nothing worse than taking code that works and having to change it to make it work on a newer version of the platform. That’s just wasted time.

3. Scalability/Performance/Reliability
With over twenty years and thousands of man-years of development, Java is a rock-solid platform that performs on a level that can match or even exceed that of native code (thanks to some of the optimisations made by the JVM using dynamic rather than static code analysis). When it comes to scalability, just look at some of the large enterprises using Java: Twitter (who moved off Ruby-on-Rails to the JVM because RoR wouldn’t scale), Spotify, Facebook, Salesforce, eBay and, of course, Oracle. Hadoop, Cassandra and Spark, the basis of most big data projects, are either written in Java or Scala and run on the JVM. If you want scalability and performance, Java and the JVM is an obvious choice.

4. Freshness
To me this is the big one. Looking at the TIOBE graph there is a significant upswing in Java popularity since October 2014, which is shortly after the launch of JDK 8. JDK 8 was a big change for developers using Java because of the introduction of Lambda expressions and the streams API. Suddenly Java developers could do things in a more functional way without having to learn a whole new language like Scala. These features also make it potentially much simpler to take advantage of multi-core/multi-processor machines without having to write lots of complex and potentially error prone multi-threaded code. With project Jigsaw scheduled for delivery in JDK 9 we’ll see modularity make big enterprise applications much easier to build, deploy and maintain. There are already plans for new language features, like value types, in JDK 10.

I look forward to seeing Java being awarded Programming Language of the Year in another ten years’ time.

15 Common WordPress Errors With Solutions

We all love WordPress, but sometimes it can drive us crazy! Whether its the dreaded white screen of death, an unknown PHP error coming from a plugin or server issues causing our site to crash, it’s never fun. But whenever WordPress decides to act up, don’t worry yourself at all – there is always a solution as you’re going to learn in this post. Get ready to have fun because you and me are going to solve 15 common WordPress errors. So without further ado, let’s start with the most common WordPress error.

1. Internal Server Error

Almost every WordPress user I know has encountered the internal server error at least once. It’s quite annoying because, unlike many common WordPress errors, the internal server error does not tell you what you need to fix. This can be frustrating since the error can be a result of several reasons as you’ll see below.

Internal Server Error Causes:

Some of the possible causes for the Internal Server error are the following:

  • Corrupted plugin functions
  • Corrupted theme functions
  • Corrupted .htaccess
  • Exhausted PHP memory limit

Internal Server Error Solutions:

This error can easily send a beginner into panic mode but worry not, here are some solutions.

a. Edit .htaccess file
Since the internal server error is mainly a result of a corrupted .htaccess file, login into your WordPress root directory via File Manager (or FTP) and rename your .htaccess file to .htaccess.old. Refresh your browser to see if you solved the error. If the error disappeared, go to Settings -> Permalinks and click on the Save Changes button to reset your .htacess and flush write rules. If this does not work, perhaps you need to check your plugins.

b. Deactivate all plugins
A plugin you just installed could be the problem, but that’s great because you know what to uninstall or delete. Other times, this WordPress error may crop up as a result of an old plugin (or several plugins that are incompatible). You won’t know for sure if the problem is your plugins unless you deactivate the plugins.

c. Change Themes
If the problem was not the plugins, perhaps your theme is. Switch to the Twenty Twelve theme and reload your website. If you’re still seeing the error, perhaps you need to upgrade some of your WordPress folders.

d. Repair the wp-admin and wp-includes folders
By this point, you’ve probably solved this WordPress error. But if this is not the case, try replacing your wp-admin and wp-includes folders with newer ones from a fresh WordPress install.

e. Increase your PHP memory Limit
If everything else fails, you have to get down and dirty and mess with a few things on your server. The internal server error can be frustrating, so I don’t expect anything to stop you. Here is a great guide on increasing PHP memory by the good guys at WordPress.If you like taking shortcuts, fire up your code editor and create a text file named php.ini. Inside this file, add this code:

memory=64MB

Save and upload the file to the /wp-admin/ folder. If increasing your PHP memory solves the problem, talk to your web host to put a finger on what is exhausting your memory. It could be anything from broken theme functions to poorly designed plugins among other things. Your web host will furnish you with information from your server logs.

2. Auto-Update Failed

WordPress now comes with an auto-update feature that takes care of security, minor bugs and such like things. The feature is pure genius at work. It’s great but sometimes it fails. Considering the auto-update feature does not require any human input, how do you tell when the update fails? You will see one of the following:

  • A PHP error message
  • A blank white screen (Also known as the white screen of death – WSOD)
  • A warning that says the update failed

Update Failed Causes:

  • Internet connection problems during auto-update
  • Broken connection with main WordPress files
  • Incorrect file permissions

Update Failed Solution:

Update your WordPress website manually. If you don’t know where to start, please check out this Updating WordPress – Manual Update post at WordPress Codex.

3. Syntax WordPress Error

My analysis showed that this is a very common WordPress error among people who add code snippets to their WordPress sites. When you encounter this error, you will usually notice something like:

Parse error - syntax error, unexpected $end in /public_html/your_site/wp-content/themes/your-theme/functions.php on line 38

This error needn’t stress you out for it tells you exactly where to find the problem.

Syntax Error Cause:

Many a time, the syntax error is caused by some missing or unexpected character(s) in the problematic file. Most of the time caused by someone less experienced trying to edit the code in a theme or plugin but it could also occur when you’ve installed a new theme or plugin that contains the error.

Syntax Error Solutions:

a. Educate yourself on pasting code snippets into WordPress
As a WordPress beginner, you have a long (but fun) way to go as far as learning WordPress development is concerned. There is no hurry though, so take your time. If you encountered this WordPress error after adding code snippets into your WordPress website, you need to learn more about pasting code snippets into WordPress or you will cause more damage.

b. Fix the affected code
If this WordPress error occurred after updating a plugin or pasting some code from the web, you know exactly where to look. The problem is you can’t fix your code via Appearance -> Editor (or Plugins -> Editor) since the syntax error locks you out of your website.This doesn’t auger well with most beginners, so they freak out. But don’t be, you can easily edit your WordPress files via FTP or File Manager in your cPanel. Find the affected file and fix the code either by removing it or rewriting it correctly.

c. Try a different theme or plugin
If the error began when you activated a new theme or plugin then it’s most likely an error in that theme or plugin. So you might want to find an alternative one or contact the developer so they can fix the error. In some cases you might not be able to log into WordPress in which case you might have to delete the plugin or theme via FTP.

4. Error Establishing A Database Connection

Of the common WordPress errors, this is pretty self-explanatory. The error lets you know something broke the connection to your WordPress database.

Database Establishing Error Causes:

  • wp-config.php error
  • Problems with your hosting provider
  • You’ve been hacked! And here I was thinking this particular WordPress error is no big deal.

Database Establishing Error Solutions:

a. Edit your wp-config.php file
Access your wp-config.php file via File Manager or FTP and confirm if the database name, host, username and password are correct. If you’re stuck or don’t know what to do first, consider teaching yourself a few things about editing wp-config.php files.

b. Fix issues with your web host
If your wp-config.php is looking right and this WordPress error is still a problem, you should talk to your WordPress hosting provider. They will be able to tell you whether the server is down or your database was shut down for exceeding its quota. If they tell you everything looks good on their end, it is time to implement some WordPress security on your site.

c. Scan your website to determine if it’s compromised
Hackers don’t sleep. No, they don’t. You can fall victim to a hacker anytime, especially if you don’t know how to secure your WordPress website. To ensure your website hasn’t been hacked, scan it using a tool such as Sucuri Sitecheck. If you get bad news, just stay calm and check out this my site was hacked post over at WordPress Codex.

5. Briefly Unavailable For Scheduled Maintenance Error

1, 2, 3… Break time over, let’s try and understand why you’re getting this not-so-brief WordPress error. Oh, by the way, it shouldn’t trouble you at all since it’s quite easy to solve. But first, let’s look at the causes.

Scheduled Maintenance Error Causes:

  • Your WordPress update failed because some things are beyond your control
  • The .maintenance file was not deleted after the update for one reason or another

Scheduled Maintenance Error Solutions:

Are you having fun? Do you feel you can solve the above errors if/when they crop up? If you can, let’s move on to WordPress error number six (6).

6. Email Password Retrieval Does Not Work

The main cause for this is forgetfulness. Perhaps you should try some memory enhancing diet and exercises 🙂 Kidding aside…we all forget even the most important of things such as passwords, usernames and email addresses? As it were, you forgot your password and were forced to use the “Lost Your Password” page. The problem is you never received the reset link via email. You decide to try again after checking your spam folder but still, no link.

Password Retrieval Error Cause:

For some reason your WordPress installation just won’t send you the link…the cause could be a mystery! But the main problem isn’t why you aren’t receiving your password but how can you actually reset your password easily and quickly? We’ll, below are a couple solutions.

Password Retrieval Error Solutions:

a. Reset your WordPress via phpMyAdmin
This is the more technical of the two solutions I’ll present you with.

  1. Login into your cPanel and navigate to phpMyAdmin under Databases
  2. Select your database (Your web host will help you can’t find your database)
  3. Navigate to wp_users and click on Browse
  4. Go to your username and click on Edit
  5. Enter a new value (your new password) into user_pass
  6. Choose MD5 from the drop-down menu that’s under Function
  7. Click Go button at the bottom to save your changes

b. Edit your functions.php file
And now for a slightly less technical method. The functions.php file is responsible for many a thing on your WordPress website. If your email password retrieval is giving you a hard time:

  1. Navigate to “../wp-content/themes/your_live_theme/” using FTP or File Manager and download the functions.php file.
  2. Open the file in your code editor and add the following code:
    wp_set_password('DesiredNewPassword', 1);

    Replace DesiredNewPassword with your new passowrd. Number one (1) in the code is your user ID number in the wp_users table.

  3. Save and upload functions.php
  4. When you can login into your website, eliminate the code (download functions.php, delete code and upload it back to your theme folder)

7. HTTP Error 403 – Forbidden

If you get “You are not authorized to view this page. (403 error)” message when trying to login into your WordPress website, you’ve encountered one of the most common WordPress errors – the HTTP Error 403.

HTTP 403 Error Cause:

  • Problems with Directory Indexes if your blog is hosted on a Windows server

HTTP 403 Error Solution:

Add index.php to the Directory Indexes. You can solve this WordPress error easily by adding index.php to the Directory Indexes. Just go to your Control Panel -> Web Options -> Directory Indexes and add index.php.

8. Sidebar Below Content Error

I was quite perplexed when I first encountered this WordPress error. I was so convinced my theme was completely toast that I contemplated changing it altogether. However, I summoned Google spiders and a few seconds later, I realized this was just one of the most common WordPress errors. This realization took away all the worrying. A few more clicks and scrolls, I found the causes.

Sidebar Below Content Error Causes:

  • HTML errors – sometimes you might forget to close a few div elements
  • CSS errors – Other times, you might accidentally use disproportionate widths that end up messing up your entire layout

Sidebar Below Content Error Solutions:

a. Close all div elements
In most cases, pen div elements are responsible for this error. Close all open div elements and eliminate extra div elements that pushes the sidebar outside the wrap element. Use a tool such as W3 Validator to check if your HTML code could be the cause of this error.

b. Fix your CSS
Improper width ratios will mess up your layout in turn placing your sidebar below the content area. You need to keep things in proportion. For instance, if your main container is 920px in width, allocate 620px to your content and 250px to your sidebar. Leave the remaining 50px to margins and what not. Just keep things proportional. Another thing, be careful when using the float property.

9. WordPress Admin Displaying Improperly

Have you ever logged into WordPress only to find your WP Admin Dashboard all over the place? What I mean it the links are arranged improperly because the dashboard is rendering without CSS.

Admin Display Error Causes:

  • Proxy and Firewalls that black CSS files
  • Corrupted admin menu plugins

Admin Display Error Solutions:

a. Ensure you’re not behind a proxy or firewall
If you’re behind a proxy or firewall (maybe you’re accessing your website from work), try accessing your dashboard elsewhere without proxies or firewalls. You can also try purging your firewall and proxy cache and see if that works.

b. Update/Deactivate admin menu plugins
If you are getting this error after installing a plugin such as Lighter Menus and Admin Drop Down Menu for your admin menu , try updating (re-installing) it. If this WordPress error persists, deactivate the plugin.

10. Connection Timed Out Error

If your WordPress website lives on an overburdened shared server, you will see this WordPress error more often than not. The following problems are responsible for this error.

Time Out Error Causes:

  • Heavy plugins
  • Theme function errors
  • Exhausted PHP memory limit

Time Out Error Solutions:

  • Deactivate the plugins you installed recently or reset your plugins folder
  • Increase your PHP memory limit
  • Switch to the Twenty Twelve theme to determine if the problem lies in your theme

11. Warning: Cannot Modify Header Information – Header Already Sent By

This is yet another common WordPress error that troubles many WordPress users, especially beginners. If you do encounter this error, you will usually see something similar to this:

Warning: Cannot modify header information - Header already sent by (Output started at /blog/wp-config.php:34)

That last part (Output started at /blog/wp-config.php:34) tells you exactly where your error is stemming from.

Cannot Modify Header Error Cause:

  • Presence of white (blank) spaces in the affected file (in our case above, that would be wp-config.php)

Cannot Modify Header Error Solution:

You’ll need to remove the blank spaces. To get rid of this WordPress error:

  1. Download the affected file (e.g. wp-config.php) via File Manager or FTP
  2. Open the file in your favorite editor (e.g. Notepad++)
  3. Remove all spaces before the first <?php (The first <?php should be in the first line)
  4. Remove all spaces after the closing ?>
  5. Save your file

12. The Plugin Won’t Delete Error

Some plugins (and you want to stay clear of such plugins) come with hidden files that become a pain in the neck when you want to delete the plugin. This is a good reason to only download plugins (and themes for that matter) from reputable websites you trust. The problem is you can’t delete the plugin via WordPress Admin and even if you delete the plugin’s folder via File Manager (or FTP), the plugin still appears. Magic? No. Here is the…

Delete Plugin Error Cause:

  • The plugin came with hidden or nested files

Delete Plugin Error Solutions:

a. Obtain plugins from trusted sources
Don’t go picking up plugins from all over the place. If you would like to purchase a well-coded plugin, go with reputable sources such as CodeCanyon or WPExplorer. If you’re after free plugins, check out WordPress plugin repository. Prevention is better than cure, right?

b. Deleting the plugin using Secure Shell (SSH)
This solution will only work if you have SSH access to your WordPress site. This is what to do. Login into your blog using SSH and navigate to “../wp-content/plugins/“. Use the Is -aI command to list all your folders, and finally delete the problematic plugin using the rm (folder name) command.

13. WordPress Posts Returning 404 Error

It is frustrating to access every part of your WordPress website but the posts. Every time you visit a single post, you get a 404 error page – and it’s a great pain because posts are the bones and flesh of any WordPress blog.

404 Error Page Cause:

  • Problem with your permalink settings

404 Error Page Solutions:

a. Save your permalinks
This WordPress error is easy to resolve so don’t panic – you readers will be able to read your posts in no time. Just go to Settings -> Permalinks and hit the Save Changes button.

b. Fix your .htaccess file
If fixing your permalinks does not solve this error, it is time to edit your .htaccess file manually. Navigate to your WordPress root directory and download the .htaccess file. If it doesn’t exists, create a blank text file and save it as .htaccess. Add the following code to the .htaccess file:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

Save and upload the .htaccess to the same location.

14. WordPress Memory Exhausted Error

You know you’ve encountered this error when you see the white screen of death or this error message:

Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 2348617 bytes) in /home/username/public_html/your_site/wp-includes/plugins.php on line 36

Memory Exhausted Error Cause:

  • A plugin or script is eating up your memory

Memory Exhausted Error Solution:

The easiest answer is to simply increase your allocated memory. To do this, open your wp-config.php file (which is found in your website’s root directory) and add the following code:

define ('wp_memory_limit', '64M');
NOTE: You don’t have to download the file (or any other file) when using the File Manager. You can edit the files right in the File Manager. Talk to your web host if you cannot find the edit option.

15. Fatal Error Undefined Function is_network_admin

I’ve decided to end this post with a simple but very common WordPress error.

Undefined Function is_network_admin Fatal Error Cause:

  • Failed auto-update

Undefined Function is_network_admin Fatal ErrorSolution:

Further Assistance/Resources

If we weren’t able to solve your error or your specific error wasn’t mentioned in this post you can find a list of really great resources below with some more solutions to common WordPress errors and their fixes. If you still can’t find a solution you could always try contacting your webhost to see if they can assist you! WPEngine has been there for us on more then one occasion when we couldn’t fix the issue ourselves!

Conclusion

Here we are. We just revealed 15 most common WordPress errors and showed you how to solve them. We hope this post will come in handy when you encounter a WordPress error. Bookmark this resource (you will most likely need it at some point – although we hope you don’t) and please tell us how you fix common WordPress errors on your website, especially if you have a better and quicker solution to one of the common WordPress errors.

Mastering WordPress Meta Data: Querying Posts and Users by Meta Data

 

In order to customize what posts WordPress returns based on meta fields, we need to use WP_Query and specify a meta_query. If, for example, we had a custom post type called ‘films’ that had a custom field called ‘director’ we could query for films whose director was a director of one of the three Star Wars films.

Take a look at the code below and see if you can use your mastery of arrays that you gained in the last part to understand what is going on with the meta_query, which I will break down what is going on under the code.

As you can see we have an array of director’s names nestled inside of three other arrays. Let’s take it apart, piece by piece.

First, we start an array for our WP_Query args. After our first argument ‘post_type’, we begin an array to house our meta_query arguments.

Inside of that we specify which key to look for–in the case ‘director’. We also provide an array of values to search for in that key.

The last argument is how to compare those values, in this case we specify “IN” to retrieve any posts with these values in the key director.

What if we wanted films that where directed by a director of a Star Wars film, but wan’t to exclude the Star Wars Prequels? We can just add another array of arguments to our meta_query, but this time for value use an array of those films titles for the key film_title and for compare, use ‘NOT LIKE’ to exclude post that have these values in the film_title field.

Now WordPress will look for films by these three directors, whose title is not one of the three prequels.

So far I’ve shown you how to use WP_Query to find posts that have specific values for a custom field, but not how to show those fields.

Showing these fields is pretty much the same as before, but instead of using get_the_ID() to specify ID for get_post_meta() we specify it in an object context. So in our loop, which you can see below, the ID is retrieved a little differently using $query->post->ID.

Just like in the last part when we used WP_Query to find posts with certain values for various custom fields, we can use WP_Query‘s user table equivalent WP_User_Query.

For example, if we had a custom field called subscriber_level and wanted to find only those users who had the subscriber level of extra_special or super_special we could, much the same way we searched for films directed by the three directors of the Star Wars films:

Just like with WP_Query, we can combine different comparisons to further control which users our query returns. This next example combines the last query with a a query, this time of the wp_users table itself for any users whose names are Luke, Han or Leia.

In this series you’ve been introduced to WordPress meta data and learned some lessons about core PHP concepts along the way.

You’ve learned how to get the values from the fields that store post and user meta data and how to construct queries for posts and users based on meta values. With this knowledge you can are prepared to work with a few custom fields and on your way to using WordPress as a complex content management system.

How to create a WordPress location based search

I’ve done this a few times in the past but yesterday I decided to write these notes for a colleague to show how to construct a location based search for a new WordPress site he is developing. Essentially to create a location search, in this case for Property sales, we need to override the standard WordPress search with our own custom query. The following is split into sections. It’s written mostly in note form but it should be easy enough to follow. If you have any questions by all means comment and I’ll answer as best as I can.

Data

Create a new custom post type called ‘property’ which will serve as the location for the data keeping it away from the other content on the site.

Custom fields

I use Advanced Custom Fields for all of my projects these days but by all means use your own plugin or method. As long as the data is stored in wp_postmeta then this tutorial is still valid. Create something similar to the following fields in your system. These aren’t really referenced specifically later on but are a good start for search fields for this sort of site.

  • Beds (select, fixed number of options)
  • Baths (select, fixed number of options)
  • Price (number field)
  • Address (separate fields unless you want to split them manually)
  • Type (select, predefined, multiselect?)
  • Status (select, predefined… under offer, sold, available?)

Custom data

On saving a new/exsiting property post type item you need to geocode the address and save the resulting latitude and longitude into the wp_postmeta table. Use the following page to help you with this:

http://codex.wordpress.org/Plugin_API/Action_Reference/save_post

Use the ‘book’ example looking for the ‘property’ post type almost verbatim. It will show you how to trigger a PHP function on the saving of a new or existing item of content using the correct post type. You then need to Geocode (convert to latitude and longitude) the address string from the POST array and save in postmeta per above. The following page will help you with that.

http://www.andrew-kirkpatrick.com/2011/10/google-geocoding-api-with-php/

If you aren’t familiar with how to save to postmeta then the following will help:

update_post_meta($post_id, 'latitude', $latitude);

Build the search form sidebar

This can be done either in raw PHP in sidebar.php (or somewhere in the theme) or as a widget (latter method preferred for sidebars as makes it portable). If widgets then the following will help significantly as the code sample is more or less exactly what you need:

http://codex.wordpress.org/Widgets_API

Copy the code from the section titled ‘Example’. This will register a widget on the system which you can drag into one or more sidebars in Appearance > Widgets

Setting up a sidebar is here:

http://codex.wordpress.org/Function_Reference/register_sidebar

If you are using the Bones theme (my preference) then it has several set up out of the box. A sidebar has a name which you use to put the contents onto the site. The code is simply:

dynamic_sidebar($sidebar_name);

It will echo by default and outputs nothing if no widgets so nice and easy really

Build the search form

You can do in HTML/CSS as normal hard coding the values of the search or pulling from $_GET which could be where you are advised to send the data through (means you can directly link via URL to a search result rather than POST which is less portable). The form action to use for a search in WP is /?s= which will activate the search template. ‘s’ is the querystring parameter for a search term. You can perform a search without it.. A handsome chappie wrote a code sample you can use:

http://www.sean-barton.co.uk/2012/05/wordpress-search-keyword

Perform the search

search.php in your theme powers the search results as you might know. The query itself can be done anywhere so use this for layout purposes. There should be ‘the loop’ in this file as normal which is designed for search results. Before ‘if (have_posts()): the_post();’ add a PHP function call or your own to something you have defined in functions.php or simply dump your search code into search.php.. there is no ‘wrong’ way to do it.

The trigger for the search is a WP function ‘query_posts()’. It will override the array of data that ‘has_posts’ has to work with and you can use the native output loop/functions to display the results.

Constructing a custom search would be a case of building an array and passing to query_posts. You can get most of the search done this way and then split into a bit of SQL perhaps for the location based side of things. I shall go into that later.

The resource you need to map the majority of the fields would be:

http://codex.wordpress.org/Class_Reference/WP_Query

WP Query is the class which WP uses at the back of query_posts but using the latter function sets up globals which make WordPress behave differently in ‘the loop’. For searching on data stored in postmeta you would need to use ‘meta_query’, taxonomies use ‘tax_query’ and general stuff like search you just pass as attributes to the array. Examples as follows which you can break down and use if you like:

function cf_custom_search_query() {
	global $wp_query; //not sure we need this
	
	$arr = array();
	
	$author = cf_get('author'); //cf_get is a wrapper on if (isset(something)) return something; else return false;
	$genre = cf_get('genre');
	$price_from = cf_get('price-from');
	$price_to = cf_get('price-to');
	
	$paged = get_query_var('paged'); //wp function. copy verbatim
	
	$arr['post_type'] = 'property'; //post type slub
	$arr['post_status'] = 'publish'; //published only as opposed to draft or private
	$arr['paged'] = $paged; //sets the page number to show.. just leave this as is
	
	$condition = array();
	
	foreach ($_REQUEST as $key=>$value) {
		if (substr($key, 0, 5) == 'cond-') {
			$condition[] = substr($key, 5); //for multi select checkboxes
		}
	}
	
	if ($val = cf_get('s')) {
		$arr['s'] = $val; //s is the actual search term
	}
	
	$meta_query = array();
	
	if ($price_from || $price_to || $author) { //meta query is for items in post_meta. we can only pass a single array although the array can have multiple conditions
		if ($price_from && $price_to) {
			$meta_query[] = array(
						'key'     => '_price',
						'value'   => array($price_from, $price_to),
						'type' => 'DECIMAL',
						'compare' => 'BETWEEN'
					);
		} else if ($price_from) {
			$meta_query[] = array(
						'key'     => '_price',
						'value'   => $price_from,
						'type' => 'DECIMAL',
						'compare' => '>='
					);
		} else if ($price_to) {
			$meta_query[] = array(
						'key'     => '_price',
						'value'   => $price_to,
						'type' => 'DECIMAL',
						'compare' => '<='
					);
		}

		if ($author) {
			$meta_query[] = array(
						'key'     => 'author',
						'value'   => $author,
						'type' => 'CHAR',
						'compare' => 'LIKE'
					);
		}
		
		if ($meta_query) {
			$arr['meta_query'] = $meta_query;
		}
	}
	
	if ($genre && $genre != '-') { //this is a custom taxonomy. so we pass the category slug (or an array of slugs) from a category.
		$arr['tax_query'][] = array(
			'taxonomy' => 'product_cat',
			'field'    => 'slug',
			'terms'    => $genre,
		);
	}
	
	if ($condition) { //as above. another custom taxonomy
		$arr['tax_query'][] = array(
			'taxonomy' => 'condition',
			'field'    => 'slug',
			'terms'    => $condition,
		);
	}
	
	if (!$sort = cf_get('sort_order')) {
		$sort = cf_session('sort_order', 'price_low');
	}
	
	if ($sort) {
		
		if ($sort == 'price_low' || $sort == 'price_high') {
			$arr['orderby'] = 'meta_value_num';
			$arr['meta_key'] = '_price';
			$arr['order'] = 'ASC';
			
			if ($sort == 'price_high') {
				$arr['order'] = 'DESC';
			}
		} else {
			$arr['orderby'] = 'title';
			$arr['order'] = 'DESC';
			
			if ($sort == 'abc') {
				$arr['order'] = 'ASC';
			}
		}
		
		$_SESSION['sort_order'] = $sort; //so it's saved for next time if they go elsewhere and come back
	}
	
	query_posts($arr); //performs the query and sets up the globals
}

Performing a location based search

On search we have ‘s’ or ‘location’ depending on how you built your form. Up to you which field you use but perform the same Geocode on the fly as you did for the save_post step above. This will give you a latitude and longitude to search on. To get into the actual SQL of a search you would want to implement something like the following:

http://codex.wordpress.org/Plugin_API/Filter_Reference/posts_where //to add to WHERE
http://codex.wordpress.org/Plugin_API/Filter_Reference/posts_join //to add to FROM

A handy usage conversation to help with the above:

http://wordpress.stackexchange.com/questions/75381/using-dynamic-conditions-in-posts-where-filter

This is a good resource giving you all of the filters you can use to get access to the SQL of the main query:

http://codex.wordpress.org/Plugin_API/Filter_Reference/posts_clauses

Make sure to wrap your add_filter and remove_filter calls in is_search() which means you only require the LAT/LONG calculation to be done in search based queries.. or just only add/remove the filter in your search function defined in functions.php or search.php and only called on a search.. making sure to remove once used.

if (is_search()) { 
	add_filter('posts_where', 'my_posts_where'); 
	//.. and so on
	//perform search function
	remove_filter('posts_where', 'my_posts_where'); 
	//.. and so on 
}

The remove is just housekeeping, however, if you don’t remove the filter(s) then the next time you run query_posts in that same page load the same filters will be added which might mess with the result unexpectedly. To put this together you need to join in two instances of wp_postmeta or $wpdb->postmeta (in case wp_ is not the table prefix) making sure to alias uniquely:

add_filter('posts_join', 'my_posts_join');

function my_posts_join($sql) {
	$sql .= ' JOIN ' . $wpdb->postmeta . ' my_join1 ON (' . $wpdb->posts . '.ID = my_join1.post_id AND my_join1.meta_key="latitude");
	return $sql; 
}

And in posts_where:

add_filter('posts_where', 'my_posts_where');

function my_posts_where($sql) {
	$sql .= ' AND my_join1.value = "blah" '; //always start AND because it will be appended onto the main query and you can use the aliases defined in the post_join above
	return $sql; 
}

You can use the geocode values for the location entered via $_GET and then write the SQL to return the correct result based of something like this example:

https://developers.google.com/maps/articles/phpsqlsearch_v3

The section titled ‘Finding Locations with MySQL’ gives the query and some useful advice.

Get a brew and put your feet up!

How to Enable Two-Step Verification on WhatsApp

Technology giants such as Google, Apple, Microsoft, and Facebook among others have always advocated enabling two-step verification to add more security. If you still don’t use two-step verification, we recommend enabling the security feature following these simple steps for many popular services. Facebook-owned WhatsApp is the latest in the list of services to add support for two-step verification.

The new two-step verification is optional but your WhatsApp account is probably the one you want to secure first. The company assures that once two-step verification enabled, any attempt to verify phone number on WhatsApp will require the six-digit passcode that is created by the user.

Currently, the two-step verification feature is available only for beta users, we can expect it to be rolled out to all users in coming weeks. On Android, beta app users running version 2.16.341 or above will be able to enable the two-step verification. Windows 10 Mobile beta user, running version 2.16.280 of WhatsApp can enable the security feature.
To set up two-step verification for WhatsApp, you need to take the following steps:

Open WhatsApp (duh!)
Go to Settings
Go to Account
Look for Two-step verification
Tap on Enable
On the next screen, enter six-digit passcode.
Next, re-enter six-digit passcode.
Optionally, add your email address on the next screen.

In the last step – optional, as mentioned – WhatsApp asks for an email address to link with your account. This email address will let WhatsApp to send a link via email to disable two-step verification in case user forgets the six-digit passcode.

Remember that in case you user forget the six-digit passcode, WhatsApp won’t permit re-verifying the account within seven days of last using WhatsApp.

“After these seven days, your number will be permitted to re-verify on WhatsApp without your passcode, but you will lose all pending messages upon re-verifying – they will be deleted. If your number is re-verified on WhatsApp after 30 days of last using WhatsApp, and without your passcode, your account will be deleted and a new one will be created upon successfully re-verifying,” the WhatsApp team explains.

Have you set up two-step verification on your WhatsApp account? Let us know via the comments. For more tutorials, visit our How to section.

15 Easy Ways To Speed Up WordPress

WordPress is a great platform. One weakness that it suffers from, however, is it can be quite slow. Without taking the right precautions, you could end up with a sluggish site. That’s not only a hassle for repeat visitors but will cause you to lose subscribers and customers.

In this quick post, I’ll cover all of the best ways that I’ve found to consistently speed up WordPress.

Why WordPress Site Speed Matters

When a person lands on your site for the first time, you only have a few seconds to capture their attention to convince them to hang around.

Get ready to lose sleep at night: according to a report by the Microsoft Bing search team, a 2-second longer delay in page responsiveness reduced user satisfaction by 3.8%, increased lost revenue per user by 4.3%, and a reduced clicks by 4.3%.

If your site takes too long to load, most people are gone, lost before you even had a chance.

Not only that, but Google now includes site speed in it’s ranking algorithm. That means that your site’s speed effects SEO, so if your site is slow, you’re now losing visitors from impatience and reduced rankings in search engines. Yikes.

Let’s fix that.

How To Speed Up WordPress

As a side note, these are not ordered by importance or any criteria, I’ve just gathered everything I’ve learned around how to speed up WordPress page loads and listed them all here.

I guarantee that using even a few will help speed up your site.

1. Choose a good host

When starting out, a shared host might seem like a bargain (“Unlimited page views!”). It comes at another cost: incredibly slow site speed and frequent down time during high traffic periods.

If you plan on publishing popular stuff, you’re killing yourself by running your WordPress site on shared hosting.

The stress of your site going down after getting a big feature is enough to create a few early gray hairs: don’t be a victim, invest in proper hosting.

The only WordPress host I continually recommend is…

WP Engine managed WordPress hosting

My sites are always blazingly fast, never have downtime when I get huge features (like when I was featured on the Discovery Channel blog!), and the back-end is very easy to use.

Last but not least, support is top notch, which is a must when it comes to hosting. Take it from someone who’s learned that the hard way.

Head on over to the WP Engine homepage and check out their offerings, you’ll be happy you did.

2. Start with a solid framework/theme

You might be surprised to here this, but the Twenty Fifteen “framework” (aka the default WP theme) is lightweight and quite speedy.

That’s because they keep the “guts” simple; compare that to bloated frameworks which have tons of features that you will never use, slowing your site to a crawl.

From my experience, the fastest loading premium framework is definitely the Thesis Theme Framework. It surpasses the basic WordPress themes by being far easier to customize.

It’s an incredibly solid framework that won’t slow you down with excess plugins or custom edits. Make the changes right from the theme and avoid bloat, hoorah!

3. Use an effective caching plugin

WordPress plugins are obviously quite useful, but some of the best fall under the caching category, as they drastically improve page loads time, and best of all, all of them on WP.org are free and easy to use.

By far my favorite, bar none, is W3 Total Cache, I wouldn’t recommend or use any other caching plugin, it has all of the features you need and is extremely easy to install and use.

Simply install and activate, and what your page load faster as elements are cached.

4. Use a content delivery network (CDN)

All of your favorite big blogs are making use of this, and if you are into online marketing using WordPress (as I’m sure many of my readers are) you won’t be surprised to here that some of your favorite blogs like Copyblogger are making use of CDN’s.

Essentially, a CDN, or content delivery network, takes all your static files you’ve got on your site (CSS, Javascript and images etc) and lets visitors download them as fast as possible by serving the files on servers as close to them as possible.

I personally use the Max CDN Content Delivery Network on my WordPress sites, as I’ve found that they have the most reasonable prices and their dashboard is very simple to use (and comes with video tutorials for setting it up, takes only a few minutes).

There is a plugin called Free-CDN that promises to do the same, although I haven’t tested it.

5. Optimize images (automatically)

Yahoo! has an image optimizer called Smush.it that will drastically reduce the file size of an image, while not reducing quality.

However, if you are like me, doing this to every image would be beyond a pain, and incredibly time consuming.

Fortunately, there is an amazing, free plugin called WP-SmushIt which will do this process to all of your images automatically, as you are uploading them. No reason not to install this one.

6. Optimize your homepage to load quickly

This isn’t one thing but really a few easy things that you can do to ensure that your homepage loads quickly, which probably is the most important part of your site because people will be landing there the most often.

Things that you can do include:

  • Show excerpts instead of full posts
  • Reduce the number of posts on the page (I like showing between 5-7)
  • Remove unnecessary sharing widgets from the home page (include them only in posts)
  • Remove inactive plugins and widgets that you don’t need
  • Keep in minimal! Readers are here for content, not 8,000 widgets on the homepage
Overall, a clean and focused homepage design will help your page not only look good, but load quicker as well.

7. Optimize your WordPress database

I’m certainly getting a lot of use out of the word “optimize” in this post!

This can be done the very tedious, extremly boring manual fashion, or…

You can simply use the WP-Optimize plugin, which I run on all of my sites.

This plugin lets you do just one simple task: optimize the your database (spam, post revisions, drafts, tables, etc.) to reduce their overhead.

I would also recommend the WP-DB Manager plugin, which can schedule dates for database optimization.

8. Disable hotlinking and leeching of your content

Hotlinking is a form of bandwidth “theft.” It occurs when other sites direct link to the images on your site from their articles making your server load increasingly high.

This can add up as more and more people “scrape” your posts or your site (and especially images) become more popular, as must do if you create custom images for your site on a regular basis.

Place this code in your root .htaccess file:

disable hotlinking of images with forbidden or custom image option
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?sparringmind.com [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?google.com [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?feeds2.feedburner.com/sparringmind [NC]
RewriteRule \.(jpg|jpeg|png|gif)$ – [NC,F,L]

You’ll notice I included my feed (from FeedBurner), you’ll need to replace it with your feed’s name, otherwise your images won’t appear correctly there.

9. Add an expires header to static resources

An Expires header is a way to specify a time far enough in the future so that the clients (browsers) don’t have to re-fetch any static content (such as css file, javascript, images etc).

This way can cut your load time significantly for your regular users.

You need to copy and paste the following code in your root .htaccess file:

ExpiresActive On
ExpiresByType image/gif A2592000
ExpiresByType image/png A2592000
ExpiresByType image/jpg A2592000
ExpiresByType image/jpeg A2592000

The above numbers are set for a month (in seconds), you can change them as you wish.

10. Adjust Gravatar images

You’ll notice on this site that the default Gravatar image is set to… well, nothing.

This is not an aesthetic choice, I did it because it improves page loads by simply having nothing where there would normally be a goofy looking Gravatar logo or some other nonsense.

Some blogs go as far to disable them throughout the site, and for everyone.

You can do either, just know that it will at least benefit your site speed if you set the default image (found in “Discussion”, under the settings tab in the WordPress dashboard) to a blank space rather than a default image.

11. Add LazyLoad to your images

LazyLoad is the process of having only only the images above the fold load (i.e. only the images visible in the visitor’s browser window), then, when reader scrolls down, the other images begin to load, just before they come into view.

This will not only speed you page loads, it can also save bandwidth by loading less data for users who don’t scroll all the way down on your pages.

To do this automatically, install the jQuery Image Lazy Load plugin.

12. Control the amount of post revisions stored

I saved this post to draft about 8 times.

WordPress, left to its own devices, would store every single one of these drafts, indefinitely.

Now, when this post is done and published, why would I need all of those drafts stored?

That’s why I use the Revision Control plugin to make sure I keep post revisions to a minimum, set it to 2 or 3 so you have something to fall back on in case you make a mistake, but not too high that you clutter your backend with unnecessary amounts of drafted posts.

13. Turn off pingbacks and trackbacks

By default, WordPress interacts with other blogs that are equipped with pingbacks and trackbacks.

Every time another blog mentions you, it notifies your site, which in turn updates data on the post. Turning this off will not destroy the backlinks to your site, just the setting that generates a lot of work for your site.

For more detail, read this explanation of WordPress Pingbacks, Trackbacks and Linkbacks.

14. Replace PHP with static HTML, when necessary

This one is a little bit advanced, but can drastically cut down your load time if you are desperate to include page load speeds, so I included it.

I’d be doing this great post injustice if I didn’t link to it for this topic, as it taught me how to easily do this myself, in a few minutes.

So go there and check it out, it wrote it out in plainer terms than I ever could!

15. Use CloudFlare

This is similar to the section above on using CDN’s, but I’ve become so fond of CloudFlare since I discussed it in my best web analytics post that I’ve decided to include it separately here.

To put it bluntly, CloudFlare, along with the W3 Total Cache plugin discussed above, are a really potent combination (they integrate with each other) that will greatly improve not only the speed, but the security of your site.

Both are free!

Thanks for reading! Please share this article if you enjoyed it.

 

10 Ways to Quickly Generate Leads

You’ve printed flyers, you’ve sent out mailers, you have blasted your social-media followers, but you’re still not getting the lead flow you need to grow your company into the next billion-dollar brand. Well, there are hundreds of ways to generate leads, so don’t hang your head.

Here are ten ways to quickly generate leads.

1.eBooks

These work great for B2B companies or a business that works in a very technical space, as people love to read and gain expertise about their industry. Make sure you don’t promote your services or products. People don’t want to be sold, they want to be informed. So write it from a neutral perspective and give actionable insights. Share the eBook socially and ask your network to share it for you.

You’ll want to ensure that you have a landing page set up that requires visitors to input their name, email and phone number for a chance to download the eBook.

2. Newsletter

Do you have a newsletter yet? If not, you’re missing out on one of the simplest way to generate more leads. Make sure you put a newsletter sign up in every possible place that makes sense on your website.

With these newsletter, not only do you have a captive audience (people have to opt-in to your newsletter) but email pathways are a great way to avoid getting lost in all the Internet noise. Again, don’t make it all about you. Instead, share with your contacts your insights, recent wins you created for your customers and industry news.

3. Blog

Having a blog is one of the best lead generating tools you can use, as it not only allows a company (or person) complete control of what is said but also an opportunity to have the undivided attention of the reader. Make sure that your blog is optimized to generate leads by having a sign-up section for your newsletter and by using the margins to promote your products and services. And I feel like a broken record, but don’t make the blog all about you! Give real value.

4.Twitter

Twitter is a dream for generating leads. Use it to reach out to influencers in your industry and get into conversations with them. Their followers, who are probably some of your potential customers, will see your interactions and follow you or visit your site. You can also follow trending subjects that pertain to your business and interject your thoughts into the general discussion by using the # symbol. For instance, if you are in the mobile world, you may use #iphone to find and eventually get leads.

5. Networking events

While a lot of action happens in the digital world, the real world still provides a lot of advantages — especially networking events. Even events that didn’t directly pertain to my business have provided me with some of the most valuable contacts and leads. You’ll meet more people, expand your network and gain referrals. Plus, it’s a great way to build your brand. Make sure to bring business cards and don’t be afraid to ask the people you meet for their patronage.

6. Develop an engaging video

Please don’t produce another terrible commercial and post it on YouTube. The world doesn’t need any more of these. What people always want more of is entertainment. So, spend some time on developing a great idea that promotes your business and engages your customers. Once you’ve uploaded the video, you can get the ball rolling on making it go viral by using services like StumbleUpon to drive traffic to your video for pennies per viewer. Video sites like YouTube allow you to put links directly into the video. Use these to link back to specific landing pages on your website.

7. Infographic

Yes, infographics may have been overused a few years back, but people still share them and still stop and read them whenever they can.They’re quite cheap to produce as well. Simply come up with an original idea (again, don’t make it about you), find a quality (but affordable) graphic designer, then share it socially and ask your network to pass it along. You can also submit your infographics to publications that cover your industry.

Always put your logo and website URL on the bottom of the infographic. This way readers will be able to visit your site.

8. Webinars

Webinars are an inexpensive way to get your message to thousands of potential customers. There are many services that allow you to broadcast a webinar quickly and easily. And if you make it a recurring event, you’ll continue to grow your following. So, come up with a great idea that helps your customers and promote it using social media, your network and your newsletter.

At the end of the webinar, feel free to ask the attendees to download an eBook, sign up for your newsletter, or visit your site. This will bring the leads flowing in.

9. Media coverage

Do you know what journalists hate? Being hit up by dozens of PR agencies hour after hour, day after day. Do you know what journalists hate a little less? Having an owner of a company reach out to them and tell their story in a real and authentic manner. In fact, your chances of being covered go up significantly if you do the reach out yourself (as long as your pitch is on point). A few tips regarding reaching out to journalists: Don’t mass email them, do not open with “to whom it may concern” and don’t pester them (one follow up email is sufficient).

By getting your name out in the media, you begin to develop a following, increase your personal brand and come off as an expert in your domain – all that can help you get leads.

10. Strong branding

Customers love authentic companies. They like it when a company has a strong and clear message and that message is consistent across all of their marketing platforms. So, don’t try and be everything to everyone. Customers want the experts and the company that is the best in their industry. Focus on communicating that through your branding and your conversion rates will go up, resulting in more leads.

Step-By-Step Guide to Index your WordPress website by Google

Who doesn’t want more organic search traffic to their sites? The definite answer is none.

Organic search is absolutely critical as it is the source of 64% of the total traffic to a website. There will be no value of this number if search engines don’t index your site. It’s as simple as that.

What is indexing of a website?

Indexing is referred to search engine recording your web pages and showing it up every time a user look for the information similar to your web pages. Mostly, when a bot of search engine arrives at your website, it starts crawling. Based on ‘noindex’ or ‘index’ meta tags, the bot adds pages in the search engines with index tags.

How do you get your website indexed by all major search engines?

There are two ways to do that. One is to create a WordPress website and sit back and relax, while indexing happens naturally (which will take a long time) and the other one is putting some efforts and make it happen. If you’re ready to implement the second method, then continue reading.

1.     Understanding the working of search engines:

You won’t be able to do much if you don’t know how exactly the major search engines like Google Yahoo, Bing and other works. Almost all search engines count on spiders that use algorithms to do the indexing which is not difficult to understand. The work of spiders is to find out the new content on the internet and figure it what it is all about. A new content could be from anywhere, an existing page, a new site or a new blog.

In earlier days, you could force a bot to index and rank your webpages based on how many times a particular search keyword is used. But today, doing this will get you penalized. It doesn’t mean that keywords no longer helps a website getting indexed on the search engines but with that, you have to take care of few other things like social signals, valid codes, quality incoming links and much more. All of this won’t matter until spiders tell the search engines where to begin and that’s when indexing comes in.

Imp: Spiders will note down every time a new document and changes added to a webpage, and it’ll process it and note down the location. When a user searches for the information associated with the similar keywords, Spiders get to the work and find the links on pages and add them to the list of crawled pages.

So, it’s always important to check a recently published article to know that Google has already found it. You can use a site:domain.com to search the same and ensure your page is easy to find.

2.      Add articles and blogs

Write in-depth and high quality blogs regularly and you’ll see why it’s worth writing. High percentage of the retailers say their customers are from the blog posts, and more than 60% of the people buy products or services based on the blogger’s recommendations.

It’s very simple and for every industry, niche and business. Just create a blog post about a product, add some high pixel images and links to the page as this will help product page to get indexed and crawled by search engine bots.

Content Strategy

As we have already mentioned the value of blogs, it’s to your own benefit to have a good content marketing strategy. A well-written content helps you focus on increasing conversions of the leads. It doesn’t have to be difficult or complex. Simply:

  • Write GPs (Guest posts) and submit it the sites similar to your niche
  • Create PRs (Press releases) and publish them on PR sites.
  • Blogs on article directories.
  • Prepare videos and host on major platforms like Youtube or Vimeo.

Note: Don’t try shortcuts by posting your content on spammy sites as Google will then consider your site as spammy too.

3.      Use Google Analytics

You need basic analytical tools to know the performance of your website and what better than Google analytics suffice to this need?

Setting up Google Analytics suggests Google that your website is on the internet and may help in triggering the indexing and crawling process. It’s the additional advantage, but you need it for knowing the total number of user visits, the time length spent on a page, pageviews and much more.

Also, you can use it for advanced tricks like tracking conversions and setting goals.

4.      Submitting To Google Search Console (GSC)

Image “google search console” Here

GSC is a mishmash of SEO tools and reporting that offers configuration and data to control your website by providing you direct insight on how Google is indexing your website. Check out following reasons why should you use this tool as an imperative part of your website.

Helps bloggers:

  • To monitor visibility on search engines and ‘404 not found’ errors.
  • To know the keywords, their sites are ranking for.
  • In Improving the sire indexing and crawling
  • To monitor if a website is indexable by bots
  • Issues that need fixing like HTML improvements
  • Submitting the sitemap to Google

5.      Submitting Website’s URL to Search Engines

On Google, you can submit your website’s URL by logging in to your account and navigate to “submit URL” found in Webmaster Tools. Then enter the URL and click on the option that says, “I’m not a robot”. Now, click submit and your website will get submitted to Google. Similarly, you can add the URL to Bing which will automatically submit it to the Yahoo.

6.      Sitemap

Sitemap is a list in XML format of every page which let the search engines know that something’s changed when you upload a new page or edit a page on your website. They significantly help your website to get crawled quickly. If you have submitted a Sitemap, it means Google knows about your URL. You can follow instructions of Google on how to add an HTML file. Once you have added your website, go to the Dashboard, then to that website and click on “Sitemaps” and add it on your website.

There is no restriction on how many times you can submit the sitemap to Google but just ensure that every time you are updating the content or images, add a sitemap.

7.      Social Media

It is one of the most effective methods to generate the traffic on your website. You can start with StumbleUpon, Facebook, Twitter, Google Plus, and the other main search engines for faster indexing of your content. Not only social media pages but also create social media profiles on YouTube channels, LinkedIn profiles or company pages, Facebook and Twitter pages and Pinterest profiles to add links that point to your website.

Bonus:

Perhaps, you know that if you submit a URL to a blog directory, it’ll help your site indexed by not and will easily be found by potential users, and if you know the right way to do it, it’ll make indexing quicker than usual. Submit your URLs to only best authority and industry blogs if you need to get in the top search results of search engines. Not only it will open up your content to new traffic but also helps you with incoming links that are easy to crawl and index by search engines. Isn’t that you need? Also, You might want to know about the TopRank and Technorati which are two of the top blog directories across the world to submit your RSS feed and blogs

Now, you have seven efficient methods for getting your website indexed by search engines to drive more and more traffic.

It isn’t an exhaustive list as there are techniques like bookmarking, commenting on various forums and much more. The point is there are various techniques and methodologies arises on the daily basis when it comes to search engine ranking. So, stay updated and use everything you can for better ranking of your website.

Google’s Toughest Interview Questions

Google has a reputation for asking difficult brain-teaser questions that challenge how you act under pressure.

Most of them require you to think quantitatively and broadly, and test the way you tackle problems on the spot.

Google probably switches up its questions over time, but career website Glassdoor provides a glimpse of the types of brain-stumping puzzles Google has asked in the past.

Not all of Google’s tricky questions are necessarily meant to be brain teasers–some of them sound simple, but turn out to be difficult to answer in a concise way.

1. What is your favorite Google product, and how would you improve it?–Associate Product Manager, January 2016

2. If you wanted to bring your dog to work but one of your team members was allergic to dogs what would you do?–Associate Account Strategist, December 2014

3. If ads were removed from YouTube, how would you monetize it? – Associate Account Strategist, January 2016

4. What do you know about Google?–Administrative Business Partner Interview, February 2015

5. Design an evacuation plan for the building.–Business Analyst Interview, November 2014

6. Which do you think has more advertising potential in Boston, a flower shop or funeral home?–Account Strategist, October 2015

7. A coin was flipped 1000 times and there were 560 heads. Do you think the coin is biased?–Quantitative Analyst, September 2015

8. What does “being Googley” mean to you?–Product Specialist, December 2015

9. Name a prank you would pull on x manager if you were hired.–Google Applications Support Engineer, June 2014

10. What is your opinion on whether or not individuals should be required to use their official name when opening a gmail or Google + account?–Administrative Assistant Interview, April 2014

11. What would you want to do if you didn’t have to work?–Interaction Designer, September 2014

12. What scares you?–Business Analyst Interview, September 2014

13. How many ways can you think of to find a needle in a haystack?–Business Associate, May 2014

14. Estimate the number of tennis balls that can fit into a plane.–Intern, December 2015

15. If you could be remembered for one sentence, what would it be?–Associate Account Strategist Interview, March 2014

16. If you could only choose one song to play every time you walked into a room for the rest of your life, what would it be?–Associate Account Strategist Interview, March 2014

17. How do you think the digital advertising world will change in the next 3 years?–Creative Director, January 2016

18. What three things would you change at your university/work place if you were CEO today?–Account Strategist Interview, April 2014

19. Describe AdWords to a seven-year-old.–Associate Account Strategist Interview, December 2014

20. You have a grocery delivery service (similar to Amazon Fresh) which delivers food within 24 hours. Estimate how many trucks you need to operate this service.–Product Manager, November 2015

21. How would you explain cloud computing to a 6 year old?–Product Manager, November 2015

22. Tell me what you think about Google charging users $1/month to use GMail.– BOLD Candidate, October 2015

23. How many haircuts do you think happen in America every year?–Business Associate, May 2014

24. List six things that make you nervous.–Android Support Level III, July 2014

25. Tell me something about you that isn’t on your resume.–Associate Account Strategist Interview, March 2014

26. What is the market for driverless cars in the year 2020?–Product Manager, November 2015

27. Model raindrops falling on a sidewalk (sidewalk is 1m and raindrops are 1cm). How could we know when the sidewalk is completely wet?–Software Engineer, January 2016

28. How would I explain the importance of HTML 5 to Larry Page and then to my grandma. — Creative Specialist, January 2016

29. Tell me a joke. — Executive Assistant Interview, March 2014

30. The best question in my opinion was, they asked me at this stage whether you prefer earning or learning. — Software Engineer, January 2016

31. If I gave you 10 million dollars right now, what would you do?–Associate Account Strategist, May 2014

32. Define a service that would allow you to travel to the future.–Interaction Designer, December 2015

33. Would you remove the link to an extremist piece of writing?–Legal Assistant, December 2015

34. How could you solve humankind’s biggest crisis given one billion dollars and a spacecraft?–Database Administrator, December 2015

35. You have a colony on Mars that you want to communicate with. How do you build a system to communicate with them?–Associate Product Manager, November 2014

36. How many cars travel across a bridge each day?–Advertising Interview, September 2014

37. If you had access to a bank’s database, how would you use that information to design an ATM for elderly people?–Associate Product Manager, February 2015

38. How would you improve a shoe factory?–Field Operations Specialist, November 2014

39. Design a mobile social app for a chain of local orthodontist offices.–Product Manager, November 2015

40. What are the number of new book titles published in the US each year?–Product Manager, November 2015

41. How would you solve homelessness in downtown San Francisco?–Product Manager, November 2015