Title: Cannot modify header information
Last modified: October 11, 2023

---

# Cannot modify header information

 *  Resolved [Jim Reekes](https://wordpress.org/support/users/reekes/)
 * (@reekes)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/cannot-modify-header-information-193/)
 * I’m migrating my site to a completely new host and installation, with new theme
   and coding. I very much would like to keep Top 10. I wanted to export the count
   for some 3,500 articles (some as much as 160,000 views). I can see this when 
   I view the Popular Posts page in the plugins’ admin settings.
 * Yet when I click on “export overall tables” I get:
   `**Warning**: Cannot modify
   header information - headers already sent by (output started at /home/customer/
   www/my-old-site.com/public_html/wp-content/plugins/top-10/includes/admin/class-
   import-export.php:306) in **/home/customer/www/my-old-site.com/public_html/wp-
   content/plugins/top-10/includes/admin/class-import-export.php** on line **309**`
   I tried recreating the database keys and rebuilding the tables, but I still get
   this error.
 * I tried looking in the WP tables and couldn’t find the Top 10 data.
 * How can I export a list of all the posts and their view counts?

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

 *  Plugin Author [Ajay](https://wordpress.org/support/users/ajay/)
 * (@ajay)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/cannot-modify-header-information-193/#post-17115303)
 * [@reekes](https://wordpress.org/support/users/reekes/)
 * The plugin saves the data in the wp_top_ten and wp_top_ten_daily tables (wp can
   be a different prefix if you’ve changed that). Are you able to see these? It 
   might be easier for you to move the tables via the backend (i.e. phpMyAdmin) 
   especially given the volume of the posts that you have vs using the import/export
   in the admin which relies heavily on PHP limits etc.
 * I’m confused on the error as I haven’t changed that piece of code and have got
   it working for me. Is there a way for you to suppress warnings on your install?
 *  Thread Starter [Jim Reekes](https://wordpress.org/support/users/reekes/)
 * (@reekes)
 * [2 years, 8 months ago](https://wordpress.org/support/topic/cannot-modify-header-information-193/#post-17116104)
 * I do have access to the tables via phpMyAdmin. I can export `wp_top_ten` but 
   it lists the post ID, which will be different on the new site. So I haven’t found
   a way to migrate the views count to the new site. I’ve been using _WP Import 
   Export Lite_ for migrating data (a great tool) but it doesn’t show `wp_top_ten`.
 * Oddly, the export/import functions in your plug in do not work for the new site
   which doesn’t yet have any views. The `wp_top_ten` table is zero length there,
   but I get the same error.
 * If I disable `display_errors` I get a new web page showing:
 * `"Post ID",Visits,"Blog ID" <followed by 3 number separated by commas, then a
   CR>`
 * Is that how it’s suppose to work? I’m to save the html web page myself? I was
   expecting it would create a CSV file to save.
 * Let’s say that’s how it suppose to work and I save the html, and correct it to
   be CSV. How should I go about updating the post IDs to the new site’s IDs?
    -  This reply was modified 2 years, 8 months ago by [Jim Reekes](https://wordpress.org/support/users/reekes/).
 *  Plugin Author [Ajay](https://wordpress.org/support/users/ajay/)
 * (@ajay)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/cannot-modify-header-information-193/#post-17146387)
 * Sorry for the delayed response. It is supposed to be a CSV file that gets pushed
   to download and I’m wondering if something is preventing that in your new host
   where it is trying to get displayed vs being downloaded.
 * Does it work properly at the old host?
 *  Thread Starter [Jim Reekes](https://wordpress.org/support/users/reekes/)
 * (@reekes)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/cannot-modify-header-information-193/#post-17147121)
 * Nope, it fails the same way at both hosting sites. No idea why it fails. If I
   turn off PHP errors it was export the comma separated text to the html page.
 * Then I saved the html page as a file locally, and cleaned it up with a text editor.
 *  Plugin Author [Ajay](https://wordpress.org/support/users/ajay/)
 * (@ajay)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/cannot-modify-header-information-193/#post-17158079)
 * Jim, I’ll be honest that I am at a loss. I’ll try further researching to see 
   if there is something within the code to force a download. I can’t replicate 
   it on my own installs – both apache and nginx servers.
 *  Plugin Author [Ajay](https://wordpress.org/support/users/ajay/)
 * (@ajay)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/cannot-modify-header-information-193/#post-17158222)
 * Would you be in a position to try a beta version. I think this might be a long
   shot, but I made minor changes to the code to first set the headers and then 
   try to write the file to the browser.
 * [https://github.com/WebberZone/top-10/releases/tag/v3.3.3-RC1](https://github.com/WebberZone/top-10/releases/tag/v3.3.3-RC1)
 *  Thread Starter [Jim Reekes](https://wordpress.org/support/users/reekes/)
 * (@reekes)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/cannot-modify-header-information-193/#post-17170289)
 * BINGO!
 * The beta does NOT have the problem 😉
   Export works. I get a csv file downloaded.
 *  Plugin Author [Ajay](https://wordpress.org/support/users/ajay/)
 * (@ajay)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/cannot-modify-header-information-193/#post-17170843)
 * Brilliant. Thanks for confirming. I’ll have this in the new version coming soon.

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

The topic ‘Cannot modify header information’ is closed to new replies.

 * ![](https://ps.w.org/top-10/assets/icon-256x256.png?rev=2986432)
 * [WebberZone Top 10 — Popular Posts](https://wordpress.org/plugins/top-10/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/top-10/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/top-10/)
 * [Active Topics](https://wordpress.org/support/plugin/top-10/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/top-10/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/top-10/reviews/)

 * 8 replies
 * 2 participants
 * Last reply from: [Ajay](https://wordpress.org/support/users/ajay/)
 * Last activity: [2 years, 7 months ago](https://wordpress.org/support/topic/cannot-modify-header-information-193/#post-17170843)
 * Status: resolved