Title: Convert WordPress Comments to HTML
Last modified: December 1, 2021

---

# Convert WordPress Comments to HTML

 *  [American2020](https://wordpress.org/support/users/american2020/)
 * (@american2020)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/convert-wordpress-comments-to-html/)
 * I was wondering if there is some plugin or something capable of achieving this.
 * I want to “Archive” a lot of comments on my site and would like to store them
   as static HTML pages.
 * Is there any tool out there capable of doing this?
 * Thanks in advance.
    -  This topic was modified 4 years, 6 months ago by [Jan Dembowski](https://wordpress.org/support/users/jdembowski/).
      Reason: Moved to Fixing WordPress, this is not an Everything else WordPress
      topic

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

 *  Moderator [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * (@bcworkz)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/convert-wordpress-comments-to-html/#post-15126730)
 * I’m unaware of such a plugin. Your search skills are likely as good as mine 😛
 * What would be possible is to create a comments only template that writes to a
   file instead of outputting to a browser. Creating HTML files isn’t a very efficient
   way to archive data. You’re actually better off leaving them in your database.
   If you like, it’s possible to alter your site’s comments queries to only display
   newer comments. Older ones would only be accessible through the admin area or
   some sort of special archived comments front end page.
 * Another possible archive solution would be to export the entire comments table
   from the DB. If they don’t need to be very accessible you could then clear most
   or all comments from the site. In order to access such archived comments you’d
   then need to export the current comments table and restore from the previous 
   export file. Export files can be zipped so they take up very little space.
 * The best solution depends on how accessible archived comments need to be.
 *  Thread Starter [American2020](https://wordpress.org/support/users/american2020/)
 * (@american2020)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/convert-wordpress-comments-to-html/#post-15146854)
 * [@bcworkz](https://wordpress.org/support/users/bcworkz/) Thanks. Sounds like 
   a good idea, I guess I could do something like that and have a template for the“
   post” displaying only the comments.
    Not sure how much I would have to hardcode
   parts of this in order to get it working, but will give it a try.
 *  Moderator [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * (@bcworkz)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/convert-wordpress-comments-to-html/#post-15148012)
 * There is a “[pre_get_comments](https://developer.wordpress.org/reference/hooks/pre_get_comments/)”
   action where you can add a “[date_query](https://developer.wordpress.org/reference/classes/wp_date_query/__construct/)”
   arg array to the object’s query vars to limit how far back WP should get comments.
 * Date query array structure is rather convoluted. You may find the date_query 
   examples for posts helpful. It’s the same structure, except applied to comments.
   Deep linking to the right section doesn’t work right [on this page](https://developer.wordpress.org/reference/classes/wp_query/).
   After the jump find “Date Parameters” in the Contents and follow that link.

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

The topic ‘Convert WordPress Comments to HTML’ is closed to new replies.

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 2 participants
 * Last reply from: [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * Last activity: [4 years, 6 months ago](https://wordpress.org/support/topic/convert-wordpress-comments-to-html/#post-15148012)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
