Skip to content
  • About us
  • Contact
  • en_USEN
  • viVI
FacebookTwitterPinterest
HOWTOHOWTO
  • All
    • Tips
      • Google
      • Facebook
      • Tiktok
    • Instruct
      • What is Q&A?
      • Taobao
    • WordPress
      • Code
      • Plugins
      • Themes
        • Flatsome
        • Theme Nevo
  • ShareHot
    • WordPress
    • Code
    • Plugins
    • Tips
    • Windows
    • Apple
    • Graphics
    • Experience
  • Graphics documents
    • illustrator
    • Sketchup
    • Coreldraw
    • 3ds max
    • Enscape
    • Photoshop
    • Graphics Plugin
  • Course
    • Photoshop course
    • illustrator course
    • Coreldraw course
    • Edit video course
    • Course Sketchup
    • Autocad course
    • Website management course
  • Service
  • Software
    • Windows
      • Tips
      • Office
      • Necessary
      • Tools
    • Apple
  • Game
  • News
    • Technology
    • Review
Hello!

  • Lost your password ?
HOWTOHOWTO
  • Home > 
  • Wordpress > 
  • Fix Failed to send buffer of zlib output compression error on wordpress

Fix Failed to send buffer of zlib output compression error on wordpress

By thindv 22/11/2025 0 378 Views
Fix Failed to send buffer of zlib output compression error on wordpress
Article categories

The error “Failed to send buffer of zlib output compression” usually occurs when the web server cannot send compressed data to the browser. Here are some causes and solutions. This error appears on the latest wordpress version. Some websites, even without any plugins installed, still have this error. Here are 3 ways to fix it Failed to send buffer of zlib output compression For your reference and follow.

Cause of error Failed to send buffer of zlib output compression

  1. Server configuration: Check the server configuration (such as Apache or Nginx) to ensure that zlib compression is enabled and configured properly. You can find compression related settings in the configuration file.
  2. Conflicts with plugins: If you are using a content management system like WordPress, there may be conflicts between plugins. Try disabling plugins temporarily to determine if any plugin is causing the problem.
  3. Memory full: Make sure your server is not running out of memory or disk space, as this may prevent the server from being able to perform compression and send data.
  4. Increase cache size: If you have access to PHP configuration, try increasing cache size by adjusting parameters like output_buffering.
  5. Check for PHP errors: Check the PHP error log to see if there are any error messages related to this issue.

How to handle failed to send buffer of zlib output compression error

Here are the solutions I found to share with you:

SOLUTION 1:

In plugins (or somewhere) you can have this code:

ini_set('zlib.output_compression', '1');

so, i replaced that code with

if (!is_admin()) ob_start('ob_gzhandler'); //because, in admin pages, it causes plugin installation to freeze

and Compression will remain ON.

SOLUTION 2:

You may have to use:

remove_action( 'shutdown', 'wp_ob_end_flush_all', 1 );

SOLUTION 3:

/** * The ob_end_flush() function is suitable for all levels * * This function replaces the WordPress * `wp_ob_end_flush_all()` function with an alternative function that does not cause a PHP message. */ remove_action( 'shutdown', 'wp_ob_end_flush_all', 1 ); add_action( 'shutdown', function() { while ( @ob_end_flush() ); } );

Below are detailed instructions for inserting the code you provide into your WordPress website:

How to insert code into WordPress

1. Use the Code Snippets plugin

The simplest way to add code to WordPress without editing theme files is to use the “Code Snippets” plugin.

  • Step 1: Install the “Code Snippets” plugin.
    • Go to the WordPress dashboard, select “Plugins” > “Add New”.
    • Search for “Code Snippets” and install.
  • Step 2: Add new code.
    • After installation, go to “Snippets” > “Add New”.
    • Give the snippet a name (e.g. “Compress output”).
    • Paste the following code into the content box:
  • // Solution 1
if (!is_admin()) ob_start('ob_gzhandler'); // Enable compression only on the frontend
  • // Solution 2
remove_action('shutdown', 'wp_ob_end_flush_all', 1);
  • //Solution 3
remove_action('shutdown', 'wp_ob_end_flush_all', 1);
add_action('shutdown', function() { while (@ob_end_flush()); });
  • Step 3: Save and activate the snippet.
    • Click “Save Changes and Activate” to save and activate the code.

2. Edit the theme's functions.php file

If you don't want to use a plugin, you can also insert the code into the file functions.php of the theme in use.

  • Step 1: Access the control panel.
  • Step 2: Go to “Appearance” > “Theme Editor”.
  • Step 3: Select file functions.php from the list on the right.
  • Step 4: Paste the code at the end of the file (before tag ?> if any):
    // Solution 1

    if (!is_admin()) ob_start('ob_gzhandler'); // Enable compression only on the frontend

    // Solution 2

    remove_action('shutdown', 'wp_ob_end_flush_all', 1);

    //Solution 3

    remove_action('shutdown', 'wp_ob_end_flush_all', 1);
    add_action('shutdown', function() { while (@ob_end_flush()); });
  • Step 5: Click “Update file” to save changes.

Note

  • Before making any changes, back up your website to avoid data loss.
  • After inserting the code, test your website to make sure everything is working properly.

Conclude.

It is inevitable that users using WordPress will encounter errors. This article helps you handle the Failed to send buffer of zlib output compression error on WordPress. Hope it will be of great help to you. During the process, if you can't do it, please leave a comment below.

Also you can visit Facebook fanpage of howto.edu.vn us to update the latest information

Tags : Tags Fix wordpress errors   wordpress
Share
FacebookShare on FacebookpinterestShare on PinterestMessengerShare on Facebook Messenger
twitterShare on TwitterlinkedinShare on LinkedinvkShare on VkredditShare on ReddittumblrShare on TumblrvideoShare on Viadeobuffer. bufferShare on Bufferpocket. pocketShare on PocketwhatsappShare on WhatsappViberShare on ViberemailShare on EmailskypeShare on SkypediggShare on DiggmyspaceShare on MyspacebloggerShare on Blogger YahooMailShare on Yahoo mailtelegramShare on Telegram gmailShare on GmailAmazonShare on AmazonSMSShare on SMS
thindv

thindv

I am a technology enthusiast and always desire to discover new things. I like to sit down and write and share what I like

Related articles

Fix Failed to send buffer of zlib output compression error on wordpress

How to add fonts to wordpress text editor area

By How To 04/12/2025 0

How to add fonts to wordpress. When you type…

Fix Failed to send buffer of zlib output compression error on wordpress

Code to automatically save images to hot when copying images from other pages

By How To 14/11/2025 0

Code to automatically save images to hot when copying images...

Leave a Comment Cancel reply

Categories What is Q&A? What is the structure of that place?

What is Interior Design? How much does an interior design job pay?

12/12/2025
What is Material?

What is Material? Material application in the field of design

11/12/2025
What is the poster?

What are posters? 9 Tips for designing beautiful, quick Posters

11/12/2025
What does graphic design do? Is it easy to get a job?

What does graphic design do? Is it easy to get a job?

11/12/2025
Water is the water material in Enscap

Water is the water material in Enscap

11/12/2025

Recent comments

  • male1 year ago
    On How to create a fade effect in Photoshop
    Great
  • phat phat2 years ago
    On Who is 5SMedia?
    Useful article
  • Minh Anh3 years ago
    On How to create basic materials in vray Sketchup
    Very good, admin
Copyright © 2025 HOWTO - Powered by HOWTO

5SMedia.net | hocdohoacaptoc.com | huongdansudung.vn | webantam.com

Back to Top
Hello!
  • All
    • Tips
      • Google
      • Facebook
      • Tiktok
    • Instruct
      • What is Q&A?
      • Taobao
    • WordPress
      • Code
      • Plugins
      • Themes
        • Flatsome
        • Theme Nevo
  • Share
    • WordPress
    • Code
    • Plugins
    • Tips
    • Windows
    • Apple
    • Graphics
    • Experience
  • Graphics documents
    • illustrator
    • Sketchup
    • Coreldraw
    • 3ds max
    • Enscape
    • Photoshop
    • Graphics Plugin
  • Course
    • Photoshop course
    • illustrator course
    • Coreldraw course
    • Edit video course
    • Course Sketchup
    • Autocad course
    • Website management course
  • Service
  • Software
    • Windows
      • Tips
      • Office
      • Necessary
      • Tools
    • Apple
  • Game
  • News
    • Technology
    • Review
en_US EN
en_US EN vi VI