PressTigers

Optimize Website Speed using Google Pagespeed Insights Plugin

There are multiple ways to have benefits of having a fast-loading website including higher rankings in different search engines. A recent survey has shown the following statistics about mostly websites’ loading time being too slow:

  • The Percentage of online clients expecting a web-page to load in 2 seconds is 47%
  • A site taking more than 3 seconds will be abandoned by 40% of the online clients
  • A website with slow page upload will not be able to get a return visit from 80% of the clients.

We can use plugins for our websites to test the loading speed – on page analysis about websites. For this purpose, we prefer to use Google Pagespeed Insights Plugin.

Image Optimization:

One of the best approaches to optimize images is to optimize your images in a program like Photoshop and other such programmes or online through tinypng website which is mostly used before uploading them to your WordPress site. For example, converting a .png image to a .jpg and compressing to 85% could potentially reduce the file size by more than half. Avoid uploading images that are significantly larger than what is required by website theme and then resizing them from within the WordPress editor. In case of the addition of an image to WordPress that has 3000 x 4000 pixels, you will be reducing the image size by creating thumbnails and then getting it resized to 300 x 400 pixels. WordPress will still be uploading the full size of the image. You need to make account for the affect to the speed of your page if your website is intensive about images.

Minify CSS & JavaScript:

Many WordPress themes provide a built-in option for minimizing both CSS and JavaScript. By minimizing these files, you are essentially stripping out any unnecessary details. It can encompass whitespace, undesired characters, empty lines, comments etc.

Remove Query String:

To improve your speed score, remove query strings from static resources. The performance of your cache will be enhanced with it. It will also put a good effect on your overall Google PageSpeed Score, Pingdom, Yslow and Gtmetrix.

Just install and forget everything, as no configuration is needed. Many plugins like speed booster pack, remove query strings from static resources, etc. are available for this purpose.

If you are interested to write own code, you have to use the following hooks in WordPress:

Fast Theme Loading Suggestions:

query_posts():

query_posts () is categorized as a difficult method to make changes to the main version of the query of a page by substituting it with the newer query instance. It is not a good solution as it re-runs the SQL queries and will fail significantly in few instances specially when it will be subjected to deal with the Pagination of Posts.

A reliable and modern WP Code must use some other productive methods like making use of pre_get_posts hook.

get_posts ():

get_posts() can accept few arguments but still similar in usage. The arguments it can accept could be due to different defaults. It has the tendency to return the posts array and cannot make any changes to the globally recognized variables. It is there for safe use everywhere.

WP_Query:

WP_Query empowers both get and query posts virtually but it can also create and work with its own object. It is a little more tricky but gives you more freedom and is also safe to use everywhere.

For further information, see the image below:

infographic-for-wp-query

User Comments

Leave a Reply

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

Get in Touch