Disabling WordPress X-FRAME-OPTIONS Support
Starting with version 3.1.3, WordPress introduced X-FRAME-OPTIONS support for the admin and login pages. This is a simple defensive measure against sneaky characters trying to encapsulate your blog within their own Web sites using iframes. So this new security was a welcome addition to WP for most users. I was not one of those users.
I have a simple dynamic HTML page that allows me to control all my WP installations from a single interface using iframes. Once I updated my WP installations to v. 3.1.3, my DHTML gadget stopped working. I am all for security enhancements, just don’t force them on me, or at least give me an option to easily disable any new features I did not ask for.
If you need to disable X-FRAME-OPTIONS support on your WP 3.1.3 or later, it is fairly easy to do. Open “./wp-includes/default-filters.php” and comment out the two lines containing the “send_frame_options_header” string. To simplify and automate this operation, use the following simple script (you may even add to cron to make this change automatic whenever you upgrade your WP). You will need to make sure to substitute the correct path for your WP installation.
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
#!/bin/bash # # Disable WP support for X-FRAME-OPTIONS feature that prevents WP from loading # Login and Admin pages inside iFrames. # FILE="${HOME}/public_html/wp-includes/default-filters.php" if [ -w "${FILE}" ] then if [ `grep -c "send_frame_options_header" "${FILE}"` -gt 0 ] then grep -v "send_frame_options_header" "${FILE}" > "${HOME}/default-filters.tmp" mv "${HOME}/default-filters.tmp" "${FILE}" chmod 644 "${FILE}" fi fi |
-
Joe
-
http://contest.is HustleAndCode
-
Bart
-
http://www.christinethedesigner.com Christine
-
HASTHEANSWERS
-
Christopher J
-
Alex
-
Marlon P
-
Ray D
