WordPress is the best content management system. While uploading your pdf or linking your pdf in WordPress will open the pdf in view mode. you cant able to force download it as a .zip file.

But its very easy to force the .pdf, .jpeg, .png, .gif .psd, .ai and any type of files you want. All you need is just replace your target=”_blank” in anchor tag and replace it with download=”filename.pdf”

<a href="sample.pdf" download="sample.pdf">Download</a>

Best Method for force download pdf in wordpress site

For wordpress users its very easy to force download .pdf files by adding just few lines of jquery codes to the wordpress theme footer.

WordPress dashboard->appearance->theme editor->footer.php

open footer.php file in wordpress theme editor and just paste the below jquery at the bottom line .


<script><br />
jQuery(document).ready(function($) {<br />
   $('a[href$=".pdf"]')<br />
        .attr('download', '')<br />
        .attr('target', '_blank');<br />
});<br />
</script>