Title: PHP Error when adding PHP line to functions.php
Last modified: August 19, 2016

---

# PHP Error when adding PHP line to functions.php

 *  [a_johnson](https://wordpress.org/support/users/a_johnson/)
 * (@a_johnson)
 * [16 years, 7 months ago](https://wordpress.org/support/topic/php-error-when-adding-php-line-to-functionsphp/)
 * 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.

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [Clayton James](https://wordpress.org/support/users/claytonjames/)
 * (@claytonjames)
 * [16 years, 7 months ago](https://wordpress.org/support/topic/php-error-when-adding-php-line-to-functionsphp/#post-1247130)
 * function.php is likely to be simply a typo. functions.php is correct.
 * Perhaps the location of the insertion is critical?
 * “You can stop this by adding: remove_action (‘wp_head’, ‘wp_generator’); immediately
   after the opening <?php tag in the theme’s functions.php file.”
 * Source: [http://wordpress.org/support/topic/316135?replies=7#post-1229602](http://wordpress.org/support/topic/316135?replies=7#post-1229602)
 *  Thread Starter [a_johnson](https://wordpress.org/support/users/a_johnson/)
 * (@a_johnson)
 * [16 years, 7 months ago](https://wordpress.org/support/topic/php-error-when-adding-php-line-to-functionsphp/#post-1247139)
 * Ah cool. I’ll try it. Thank you.
 * EDIT: That did the trick. Thanks again.
 *  [Clayton James](https://wordpress.org/support/users/claytonjames/)
 * (@claytonjames)
 * [16 years, 7 months ago](https://wordpress.org/support/topic/php-error-when-adding-php-line-to-functionsphp/#post-1247265)
 * You’re welcome!

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘PHP Error when adding PHP line to functions.php’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 2 participants
 * Last reply from: [Clayton James](https://wordpress.org/support/users/claytonjames/)
 * Last activity: [16 years, 7 months ago](https://wordpress.org/support/topic/php-error-when-adding-php-line-to-functionsphp/#post-1247265)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
