Title: Remove Date from Pages WordPress Function Snippet
Last modified: August 22, 2016

---

# Remove Date from Pages WordPress Function Snippet

 *  Resolved [jesse9212](https://wordpress.org/support/users/jesse9212/)
 * (@jesse9212)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/remove-date-from-pages-wordpress-function-snippet/)
 * I want to remove the last updated / last modified date from pages (not posts)
   via a code snippet in functions.php
 * I actually use the Code Snippet Plugin, but that doesn’t matter.
 * Put into SEO terms; I want to remove delete take down the google description 
   date stamp time that shows up in google search result listings that show up because
   of the date modified code built into most themes. I do not want this function
   to run on posts. Just pages.

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

 *  Moderator [Bet Hannon](https://wordpress.org/support/users/bethannon1/)
 * (@bethannon1)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/remove-date-from-pages-wordpress-function-snippet/#post-5792901)
 * I think you would remove this by editing the page template in your theme, not
   functions.php. The name of that page template file may be page.php –that’s what
   it is in the default WP themes– but your theme may be using a different file 
   name.
 * Here’s the relevant codex info: [http://codex.wordpress.org/Function_Reference/the_modified_date](http://codex.wordpress.org/Function_Reference/the_modified_date)
 * Is this what you are asking about?
 *  Thread Starter [jesse9212](https://wordpress.org/support/users/jesse9212/)
 * (@jesse9212)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/remove-date-from-pages-wordpress-function-snippet/#post-5792905)
 * Here’s the solution that saves you from having to edit your theme files or create
   a child theme:
    [http://wordpress.stackexchange.com/a/178619/62312](http://wordpress.stackexchange.com/a/178619/62312)
 *     ```
       function wpd_remove_modified_date(){
           if( is_page() ){
               add_filter( 'the_time', '__return_false' );
               add_filter( 'the_modified_time', '__return_false' );
               add_filter( 'get_the_modified_time', '__return_false' );
               add_filter( 'the_date', '__return_false' );
               add_filter( 'the_modified_date', '__return_false' );
               add_filter( 'get_the_modified_date', '__return_false' );
           }
       }
       add_action( 'template_redirect', 'wpd_remove_modified_date' );
       ```
   
 * I use a plugin called Code Snippets to have this code run on all sites in my 
   wordpress multisite installation.
    [https://wordpress.org/plugins/code-snippets/](https://wordpress.org/plugins/code-snippets/)

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

The topic ‘Remove Date from Pages WordPress Function Snippet’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [jesse9212](https://wordpress.org/support/users/jesse9212/)
 * Last activity: [11 years, 3 months ago](https://wordpress.org/support/topic/remove-date-from-pages-wordpress-function-snippet/#post-5792905)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
