Title: Comment template changes overriden after upgrade
Last modified: August 19, 2016

---

# Comment template changes overriden after upgrade

 *  Resolved [matthewpaul](https://wordpress.org/support/users/matthewpaul/)
 * (@matthewpaul)
 * [16 years, 5 months ago](https://wordpress.org/support/topic/comment-template/)
 * I’ve made some changes to the comment-template PHP file, but every time I upgrade
   WordPress, the comment-template file gets overridden by the upgrade.
 * These are just basic changes to effect the styling of the comments, but it ends
   up being a pain having to make them after every upgrade. Is there any way to 
   avoid having to re-edit this file after each upgrade?

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

 *  [henkholland](https://wordpress.org/support/users/henkholland/)
 * (@henkholland)
 * [16 years, 5 months ago](https://wordpress.org/support/topic/comment-template/#post-1324425)
 * Hi,
 * Would that be `comments.php` in the default or classic theme-folder?
    Copy the
   complete folder to a new one and give it a new name like mytheme; select that
   theme under Appearance and only modify in there! (allthough I am not sure whether
   an automatic upgrade overwrites the standard default and classic theme folders
   in wp-content, better be safe than sorry).
 * If you are referring to a file in, say, wp-admin: yes that is standard behaviour,
   so you better never modify any of thes core files (been there, done that). Ofcourse
   you can backup your modified file but simply re-uploading it after the upgrade
   could break things when there are more changes in the said file.
 *  Thread Starter [matthewpaul](https://wordpress.org/support/users/matthewpaul/)
 * (@matthewpaul)
 * [16 years, 5 months ago](https://wordpress.org/support/topic/comment-template/#post-1324533)
 * No, comment-template.php is located in wp-includes folder. The changes I make
   can only be made in comment-template.php, not the comments file. I keep a backup
   and modify a couple lines after each time I upgrade, rather than replace the 
   whole file so there’s no issue.
 * They’re minor changes, but I was hoping there was a way to avoid having to make
   them after every upgrade.
 *  [s_ha_dum](https://wordpress.org/support/users/apljdi/)
 * (@apljdi)
 * [16 years, 5 months ago](https://wordpress.org/support/topic/comment-template/#post-1324538)
 * > Is there any way to avoid having to re-edit this file after each upgrade?
 * Yes. Don’t hack the core files. Core files will be over-written every time you
   upgrade.
 * Depending upon what you want to do you may not have to hack comment-template.
   php. If you explain what you are trying to accomplish maybe someone can help 
   you avoid the core hack.
 * If you do have to hack the core files you will have to recreate the changes every
   time. I just recently started using [git](http://git-scm.com/) to make that process
   less painful.
 *  Thread Starter [matthewpaul](https://wordpress.org/support/users/matthewpaul/)
 * (@matthewpaul)
 * [16 years, 5 months ago](https://wordpress.org/support/topic/comment-template/#post-1324544)
 * I want to add a “/” between the comment author and the date so the output looks
   like:
 * > Joe / December 29, 2009 at 10:00 pm
   >  This is my comment.
 * Can this be done without modifying comments-template?
 *  [Mark / t31os](https://wordpress.org/support/users/t31os_/)
 * (@t31os_)
 * [16 years, 5 months ago](https://wordpress.org/support/topic/comment-template/#post-1324550)
 * Yes it can..
 * You can manage what’s shown in comment output by adjusting (If they exist) or
   creating (If they don’t) comment template files..
 * Like with categories, themes also support comment templates..
 * If you need control over an area the template file can’t cover, ie. it’s inside
   what’s output by wp_list_comments, then all you need to do is define a callback
   function for it.. i can give you an example if you like, but if you’re PHP capable,
   the following page should help…
 * [http://codex.wordpress.org/Template_Tags/wp_list_comments](http://codex.wordpress.org/Template_Tags/wp_list_comments)
   
   Further reading regarding using a callback function. [Google results](http://www.google.co.uk/search?q=wp_list_comments+callback&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-GB:official&client=firefox-a)
 *  [s_ha_dum](https://wordpress.org/support/users/apljdi/)
 * (@apljdi)
 * [16 years, 5 months ago](https://wordpress.org/support/topic/comment-template/#post-1324569)
 * [@matthewpaul](https://wordpress.org/support/users/matthewpaul/),
 * Looks like the ‘callback’ function is what you need. I’ve done something similar
   so I have examples too.
 *  Thread Starter [matthewpaul](https://wordpress.org/support/users/matthewpaul/)
 * (@matthewpaul)
 * [16 years, 5 months ago](https://wordpress.org/support/topic/comment-template/#post-1324586)
 * Thanks, t310s_ and apljdi. I used the example in the Codex link and worked off
   that.
 *  [Mark / t31os](https://wordpress.org/support/users/t31os_/)
 * (@t31os_)
 * [16 years, 5 months ago](https://wordpress.org/support/topic/comment-template/#post-1324587)
 * Happy you got it sorted mate.. 😉
 * Post back if you have problems.. 🙂

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

The topic ‘Comment template changes overriden after upgrade’ is closed to new replies.

## Tags

 * [comment template](https://wordpress.org/support/topic-tag/comment-template/)
 * [Comments](https://wordpress.org/support/topic-tag/comments/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 8 replies
 * 4 participants
 * Last reply from: [Mark / t31os](https://wordpress.org/support/users/t31os_/)
 * Last activity: [16 years, 5 months ago](https://wordpress.org/support/topic/comment-template/#post-1324587)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
