Cannot modify header information – headers already sent by… WordPress Issue

When running script, I am getting several errors like this:

Warning: Cannot modify header information – headers already sent by (output started at /some/file.php:12) in /some/file.php on line 23


Possible solutions

  1. header("Location: $location", true, $status);


    echo "<meta http-equiv='refresh' content='0;url=$location' />";
  2. Most of this trouble comes up because of undesirable whitespace(s) somewhere before the first "<?" and after the last "?>" in a php script. Use Notepad2 or something to edit code and better try to use in-built on-line theme editor in the admin console. Try to find and eliminate all undesidrable whitespaces in every theme’s php file and resave those files.
  3. The long term answer is that all output from your PHP scripts should be buffered in variables. This includes headers and body output. Then at the end of your scripts do any output you need.

    The very quick fix for your problem will be to add

      // code 

cast_sender.js console error

Recently I have started seeing cast_sender.js console errors in one of the websites.

Issue here was It’s the JavaScript code inside the YouTube iframe polls for the extensions it could interoperate with in case they were installed (likely to determine if the extension is installed).


A simple solution – To stop seeing those cast_sender.js errors, edit the youtube link in the iframe src and change embedto v

E.g. If you have a link ” ” Just replace to look like ” “

How to Remove line breaks _x000D_ from Excel data sheet

1 – Select the cell(s) that contain line breaks you wish to remove

2 – Press CTRL + H on your keyboard. This opens up the “Find and Replace” dialog box.

3 – In the field “Find what” where you would normally type the word/text you want to replace, you need to enter the following : ALT + 010
>>> Keep the ALT key pressed, while typing 010 using the number keypad of your keyboard (problem if you’re working on a laptop, keyboard doesn’t include number pad). You should then see a dot appear briefly then disappear in the field “Find what”.

4 – In the field “Replace with”, just enter a space (a normal blank space using your keyboard space bar)

5 – Hit “Replace All”, and all your line breaks should be gone.

Excel formula: Get percentage discount

percentage discount

If you have a discounted price and an original price, and you want to know the discount as a percentage, you can calculate the percentage discount using a formula that divides the discounted price by the original price and then subtracts the result from one.

Generic formula
= 1 - (discount_price / original_price)

How the formula works In the example?

Excel first divides the discounted price by the original price in to get value, which is then subtracted from 1: =1-(59.5/70) =1-0.85 =0.15

Note that the result is a decimal version of the percent, and must be formatted using the Percentage number format in Excel to display as a percentage.

How to Block lifehacĸ and Google Analytics Referral Spam


A Russian referrer spammer has registered various domains that use special figures – with those special figures the spammer is able to register domains like lifehacĸ and  hxxp://

The spammer uses the following URLs in the spam run (this is just a small portion):

  • hxxp://
  • hxxp://lifehacĸĸ

If you want to filter the spam run from your analytics data, then simply use the following steps:


Create an Exclude Filter

1. Open your Google Analytics account and go to the Admin tab> Cick Filters on the right side in the VIEW section.

2. Click the + ADD FILTER button to create a new exclude filter.

3. Add lifehacĸ or something you can easily remember as the Filter Name.

4. Select the Custom Filter Type.

5. In Filter Field, find and select Campaign Source in the list. In the Filter Pattern text box, add lifehacĸ and click the blue Save button on the bottom of the webpage. To add multiple URLs to the same filter you can make a Filter Pattern similar to this with a | between each URL: | Example\.com | lifehacĸ |



How to block Lifehacĸ referrer spam using your .htaccess file?

If you are aware of a way to access your .htaccess file, you will just have to write the code below in there…


RewriteCond %{HTTP_REFERER} Lifehacĸ [NC,OR]

RewriteCond %{HTTP_REFERER} Lifehacĸ

RewriteRule .* – [F]