How To Set Custom Permalink Structure For Uploaded Media Files?

You are currently viewing How To Set Custom Permalink Structure For Uploaded Media Files?

How To Set Custom Permalink Structure For Uploaded Media Files?

You can set a custom permalink structure for uploaded media files in WordPress by following these steps:

  1. Go to the WordPress dashboard and click on the “Settings” menu.
  2. Click on the “Permalinks” option.
  3. Scroll down to the “Custom Structure” section.
  4. Enter the desired custom permalink structure in the text field, using any of the available tags to specify different parts of the permalink.

For example, to include the year, month, and day in the permalink structure for uploaded media files, you can use the following structure:

/%year%/%monthnum%/%day%/%postname%/

This will create permalinks in the format:

http://example.com/2022/12/29/my-image/

Remember to click the “Save Changes” button to apply your new permalink structure.

Note that this permalink structure will be applied to all media files, including images, audio, and video files. If you want to set a different permalink structure for each post type, you will need to use a plugin or custom code to achieve this.

you can find custom code here.

This Post Has One Comment

Leave a Reply