Remove lines in your php files that reveal your WordPress version

Posted in Linux

Get rid of this line in all your WordPress php files

<meta name=”generator” content=”WordPress <?php bloginfo(’version’); ?>” /><!– leave this for stats please –>

When wordpress comes out with a new version, part of the update is usually fixing an exploitable bug.  The bug may allow a hacker to access your wp-admin directory or delete your files, or worse.  If the bug is only in version xyz, and that’s the version you’re running, you don’t want anyone googling that version to run into your pages and exploit your code.

You can use the “leave this for stats please” to find and replace that line in all your php files at once.  If you don’t have shell access, well I guess you’ll have to use whatever interface your site provider overlords have thrust upon you.

[admica@host]$  sudo for x in `grep ” leave this for stats please” /path/to/myblog -R | awk ‘{print $1}’ | grep -o -e “.*php”`; do sed -e ’s/.*leave this for stats please.*//g’ $x > $x.temp; mv $x.temp $x; done

This will find all the files that contain that line and delete it from each one.

Posted by admica   @   6 December 2008
Tags : , , ,

Related Posts

Like this post? Share it!

Digg Twitter StumbleUpon Delicious Technorati Facebook RSS

0 Comments

No comments yet. Be the first to leave a comment !
Leave a Comment

Name

Email

Website

Previous Post
« Stop SELinux from blocking flash using iced-tea firefox plugin
Next Post
Deny access to wp-admin from everyone but yourself »
Powered by Wordpress   |   Lunated designed by ZenVerse