How to download exported csv file in Wordpress How to download exported csv file in Wordpress wordpress wordpress

How to download exported csv file in Wordpress


I have fixed it.

I've inserted that code on the top of the plugin.

I think because the headers should send on the head of script and before load document or after tag.

Note:

The HTTP status header line will always be the first sent to the client, regardless of the actual header() call being the first or not. The status may be overridden by calling header() with a new status line at any time unless the HTTP headers have already been sent.

from php.net/manual/en/function.header.php