How to make media files downloadable in wordpress instead of streaming

code:
austine charles

Reviewed by:
Rating:
5
On July 1, 2017
Last modified:July 1, 2017

Summary:

By default wordpress does not allow downloading of media files and it is always annoying when you visit some entertainment blogs or mp3 download sites hosted in wordpress to download a song , video or any other file and when you click the download button it will take you to streaming page instead of starting to download authomatically . today I will be dropping line of codes you can use and authomatically make and force mp3 songs, mp4 videos and 3gp ,images and so many other file types to start downloading instead of opening new browser tab and taking you to that annoying streaming page.

 

By default wordpress does not allow downloading of media files and it is always annoying when you visit some entertainment blogs or mp3 download sites hosted in wordpress to download a song , video or any other file and when you click the download button it will take you to streaming page instead of starting to download authomatically . today I will be dropping line of codes you can use and authomatically make and force mp3 songs, mp4 videos and 3gp ,images and so many other file types to start downloading instead of opening new browser tab and taking you to that annoying streaming page.

        How to authomatically make and force media files to download in wordpres

It is as simple as abc with the line of codes below in your   .htaccess file it will be solved  for those of you who don’t know the meaning of htaccess let me define the meaning ,  what  is htaccess?  The .htaccess is a distributed configuration file, and is how Apache handles configuration changes on a per-directory basis. WordPress uses this file to manipulate how Apache serves files from its root directory, and subdirectories thereof.

 

Where can I find htaccess?

There are two ways you can find and edit wordpress htaccess. The first method is is to open your file manager but I do not recommend this for newbies I would only recommend the second method which is by editing your blog htaccess through yoast seo plugin as it is easier to understand.

How to edit htaccess using yoast seo plugin

 

It is easier editing htaccess through yoast plugin , to do that simple hover your mouse on seo then click on tools in the next page click on file editor and scroll down to htaccess and paste this code .

This code will force mp3 songs to download

<FilesMatch “.(?i:mp3)$”>
ForceType application/octet-stream
Header set Content-Disposition attachment
</FilesMatch>

 

To force mp4 videos to download use this code

<FilesMatch “.(?i:mp4)$”>
ForceType application/octet-stream
Header set Content-Disposition attachment
</FilesMatch>

 

Leave a Reply

Your email address will not be published. Required fields are marked *