Why Should You Use PHP Flush Function on WordPress


What is Flush function in PHP ? Why should we use that function on WordPress website/blog ? On using it, how could it improve the WordPress site ? Flush in general terms indicate rinse, clean, free flowing etc. So same in WordPress, when using PHP Flush function on your WordPress header php file, you will be able to speed up your WordPress blog.

The PHP Flush function on WordPress will improve the site performance speed. The Flush function simply forces your web server to send your website’s header before sending the rest of the content. When a user access your site, it normally takes atleast 10 secs to load the website completely.

When you use PHP Flush function, the partially ready HTML files from the backend are served first to the readers in lighting speed and at the mean time, the server starts fetching other files and displays completely. It helps readers not to remain their browsers idle when the server is fetching for entire files to display, rather it shows the ready HTML files first and then the rest of files such as stylesheets etc.

How to add flush() function to WordPress ?

Open your WordPress admin dashboard

Open up the header.php file

Find the tag

Insert the function right after it.

Save the file

For a limited time I'm sharing some select Tips and Tricks and How-To Guides for FREE.


  1. Nikunj says:

    great tip i think will try it this but was having a question that will it work with cache plugin

  2. nice article brother.i will definitely use on my site.thanks for sharing ………………

  3. Pankaj Gupta says:

    I followed the above steps and added it to my header file but how to see the changes? I am not able to see any changes while loading.

  4. Implementing it now. Let’s see if any noticeable improvements take place.

  5. Mouffles says:

    Hi there,
    Thank you, i spent months on speed issues beetween buddypress/wordpress and i almost tried everything possible on the server side cause the php generation times was awfull (sometimes 20 seconds for the homepage!!).

    So i add the php flush() in my header, and now everything is ok and nice, 1/2 seconds only before the page start loading, so thank you, really, thank you !


  1. Speed up Wordpress | 2Dpixel.com says:

    […] Why Should You Use PHP Flush Function on WordPress […]

Speak Your Mind