PHP Error when adding PHP line to functions.php
-
I want to remove the generator line from my pages and found the information below. However, there is no function.php just functions.php. I added the line as it said but just got a php syntax error when I tried it live. any help?
—————————————-
Security through obscurity
Security through obscurity is typically thought to be an unsound primary strategy. However, there are areas in WordPress where obscuring a bit could help with security:
1. Do not advertise the WordPress version you are running: If you are running an old WordPress version with known vulnerabilities, it is unwise to display this information to the public. Why not simply hide the WordPress version entirely? Even if you update packages as quickly as you can, there will be lag between the version release and your deployment, potentially enough time for a malicious person to carry out an attack. However, editing out all the places where WordPress advertises its version string (e.g., <meta name=”generator” content=”WordPress 2.7″ /> in every page) in your theme can be a pain. It is still best to make sure you are running the latest WordPress version. An easier way to do this is with the Replace WP-Version plugin (my newer and better version with more features is Secure WP). If you want to remove this line without a plugin, you can simply add <?php remove_action(‘wp_head’, ‘wp_generator’); ?> to your theme’s function.php file.
The topic ‘PHP Error when adding PHP line to functions.php’ is closed to new replies.