Can't access WordPress Dashboard in an iframe Can't access WordPress Dashboard in an iframe wordpress wordpress

Can't access WordPress Dashboard in an iframe


Here is a better solution that won't break when you update Wordpress:

remove_action( 'login_init', 'send_frame_options_header' );remove_action( 'admin_init', 'send_frame_options_header' );

Here's another solution if you're using Apache. Throw this in your .htaccess:

<IfModule mod_headers.c>    Header unset X-Frame-Options    Header always unset X-Frame-Options</IfModule>


According to this, in WordPress Answers, Receiving “This content cannot be displayed in a frame” error on login page, WordPress sends a special header

X-Frame-Options: SAMEORIGIN

that prevents clickjacking. And hence, embedding the admin as an iframe.

It is possible to eliminate this header removing a couple of actions from wp-includes/default-filters.php, but at your own risk.

Someone might register a domain with a very similar name, embed your login as background iframe and log the login credentials when you try to type them in.

Please, read the full Q&A at WPSE.