Category: Uncategorized

How to Fix the “Cannot Modify Header Information – Headers Already Sent By” Error on WordPress?

The “Cannot Modify Header Information – Headers Already Sent By” error is a common issue in WordPress, typically caused by whitespace or other characters being output before WordPress sends HTTP headers. Here’s how you can fix it:

  1. Check for whitespace before the opening tag:
    Similarly, make sure there’s no whitespace after the closing ?> tag in any of your PHP files. It’s often recommended to omit the closing ?> tag altogether to avoid this issue.
  2. Disable plugins and switch to a default theme:
    Deactivate all plugins and switch to a default WordPress theme like Twenty Twenty-One. If the error disappears, reactivate your plugins and theme one by one until you find the one causing the issue.
  3. Use a default WordPress file:
    Replace your current functions.php file with a fresh copy from the default WordPress installation. This can help if your current functions.php file has been corrupted.
  4. Check for BOM (Byte Order Mark):
    If you’re using a text editor to edit your files, ensure it’s not adding a BOM at the beginning of your PHP files. BOM can cause headers to be sent prematurely.
  5. Increase PHP memory limit:
    Sometimes, insufficient PHP memory can lead to this error. You can increase the PHP memory limit by adding the following line to your wp-config.php file:

    define('WP_MEMORY_LIMIT', '64M');
  6. Enable debugging:
    Add the following lines to your wp-config.php file to enable error logging and display:

    define( 'WP_DEBUG', true );
    define( 'WP_DEBUG_LOG', true );
    define( 'WP_DEBUG_DISPLAY', false );
  7. Check for any output before headers:
    Review your theme’s header.php file for any HTML or whitespace before the line.
  8. Use output buffering:
    You can use PHP’s output buffering functions to capture any output before headers are sent. Place the following code at the beginning of your functions.php file:

    ob_start();
  9. Check file encoding:
    Ensure that all your PHP files are saved in UTF-8 without BOM encoding. Some text editors, especially on Windows, may use different encodings by default.

After applying these steps, refresh your WordPress site to see if the error has been resolved. If it persists, you may need to consult with a developer or your hosting provider for further assistance.

Shutting down Google+ for consumer (personal) accounts on April 2, 2019


In December 2018, Google announced their decision to shut down Google+ for consumers in April 2019 due to low usage and challenges involved in maintaining a successful product that meets consumer’s expectations.

On April 2nd, your Google+ account and any Google+ pages you created will be shut down and we will begin deleting content from consumer Google+ accounts. Photos and videos from Google+ in your Album Archive and your Google+ pages will also be deleted. You can download and save your content, just make sure to do so before April. Note that photos and videos backed up in Google Photos will not be deleted.

The process of deleting content from consumer Google+ accounts, Google+ Pages, and Album Archive will take a few months, and content may remain through this time. For example, users may still see parts of their Google+ account via activity log and some consumer Google+ content may remain visible to G Suite users until consumer Google+ is deleted.

For more details: https://support.google.com/plus/answer/9195133

Advance Happy New Year

As You Log Out Of Last Year
And Login To This New Year,
I Wish To Send You Happy New Year Wishes
Full Of Success, Prosperity, Happiness And Joy.
May This Be A Year Of Change Unto Your Life
May God Give You Protection And Good Health
So That You Live To See Other Years To Come

How to get ID of the logged-in User in Yii2?

Logged in user information will be stored in Yii::$app->user->identity variable. The authenticated user identity information can be retrieved via Yii::$app->user->identity.
You can get ID by using below code.

<?= \Yii::$app->user->identity->ID ?>

If you have any doubts, Please comment here.