Block my website from iFrame traffic

In some cases it’s usefull to protect own website from iFrame traffic. Here are 2 solutions.

Protect with PHP

header('X-Frame-Options: deny');

Protect with Javascript

if ( !== window.self);
// Not recommend, try using PHP method.

Leave a Reply

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