Title: Why don&#039;t code comments work in content files?
Last modified: August 22, 2016

---

# Why don't code comments work in content files?

 *  Resolved [roscoedesign](https://wordpress.org/support/users/roscoedesign/)
 * (@roscoedesign)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/why-dont-code-comments-work-in-content-files/)
 * When I comment code in footer.php and save/update the file, the comments are 
   just read/parsed and displayed. Why is this? Is it not possible to comment out
   code in the wp-content -> themes -> theme_name -> file_name
 * Is deleting the only way to “remove” code from theme files? And before it’s mentioned,
   please don’t suggest creating a child theme and using the display:none option.
   I’m new to WordPress and this is baffling to me. I’ve tried searching the forum
   for answers to no avail. I will be grateful to anyone who can provide some insight
   on this behavior.

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

 *  [stephencottontail](https://wordpress.org/support/users/stephencottontail/)
 * (@stephencottontail)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/why-dont-code-comments-work-in-content-files/#post-5599521)
 * What theme are you using, and what are you trying to accomplish? Can you post
   the contents of `footer.php` to [Pastebin](http://pastebin.com/) and post the
   link here?
 * Also, can you clarify why using some custom CSS to hide the section is a non-
   starter? You wouldn’t necessarily have to create a child theme; you could use
   a custom CSS plugin instead or your theme’s built-in custom CSS option, if it
   has one. Bear in mind that if you manually edit the theme files, you’ll lose 
   those changes if the theme is ever updated in the future, to fix security issues
   or bugs or to add new features.
 *  Thread Starter [roscoedesign](https://wordpress.org/support/users/roscoedesign/)
 * (@roscoedesign)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/why-dont-code-comments-work-in-content-files/#post-5599525)
 * [http://pastebin.com/EYUZ92bF](http://pastebin.com/EYUZ92bF)
 * I’m trying to comment out the one line of code in that file to remove the “Back
   To Top” link that appears in the footer. I’m using a premium theme called florence
   BUT, I experienced the same behavior with 20-14 default theme in CSS and PHP 
   files.
 * Using custom CSS isn’t necessarily a non-starter; I just want to know why I can’t
   comment out code like in any other normal html, php, css files?
 * I prefer to back up my revisions and not use child themes, I don’t like redundancy
   regardless of how minimal the performance is affected. But even using a child
   theme is just a hack; why can’t I simply comment out code in already created 
   wordpress content files?
 *  [stephencottontail](https://wordpress.org/support/users/stephencottontail/)
 * (@stephencottontail)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/why-dont-code-comments-work-in-content-files/#post-5599591)
 * You either need to use HTML-style comments to eliminate that entire line:
 * `<!--<a href="#" class="to-top"><?php _e( 'Back to top', 'solopine' ); ?> <i 
   class="fa fa-angle-double-up"></i></a>-->`
 * or you need to use PHP-style comments just inside the PHP block:
 * `<a href="#" class="to-top"><?php // _e( 'Back to top', 'solopine' ); ?> <i class
   ="fa fa-angle-double-up"></i></a>`
 * Either would work.
 * To answer your second question, you technically are never required to use a child
   theme. However, as I posted before, if you edit the theme files directly, you’ll
   lose those changes if the theme is ever updated, to fix security issues or bugs
   or to add new features.
 *  Thread Starter [roscoedesign](https://wordpress.org/support/users/roscoedesign/)
 * (@roscoedesign)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/why-dont-code-comments-work-in-content-files/#post-5599600)
 * Thank you Stephen. I guess I needed a comment lesson/refresher.
 * I never tried using html comments, it being a php file. And I had overlooked 
   that php comments need to be placed inside the php tags to eliminate the called
   functions. I have very little experience with php scripting.
 * Again, thanks so much

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

The topic ‘Why don't code comments work in content files?’ is closed to new replies.

## Tags

 * [editor](https://wordpress.org/support/topic-tag/editor/)
 * [php files](https://wordpress.org/support/topic-tag/php-files/)

 * 4 replies
 * 2 participants
 * Last reply from: [roscoedesign](https://wordpress.org/support/users/roscoedesign/)
 * Last activity: [11 years, 6 months ago](https://wordpress.org/support/topic/why-dont-code-comments-work-in-content-files/#post-5599600)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
