How can I force a file download in the WordPress backend?
If I understand you correctly you want to have a URL something like the following whose response to the browser will be the content you generate, i.e. your .CSV file and no generated content from WordPress? http://example.com/download/data.csv I think you are looking for the ‘template_redirect’ hook. You can find ‘template_redirect’ in /wp-includes/template-loader.php which is a … Read more