The easiest way to achieve this is like most other things in WordPress, install a plugin to do the work.

You should only download and use plugins that are found in the plugin section of the website.

A good practice is to only use plugins that have been updated recently and that has more than 10 000 downloads.

This is a reputable WordPress Plugin.