IT Nota

  • Home
  • How To
  • .NET
  • WordPress
  • Contact
You are here: Home / CMS / WordPress / How to Change WordPress Upload Folder

How to Change WordPress Upload Folder

If you do a fresh install using WordPress 3.5 or later, you may have noticed that one useful feature that’s sorely missing is the ability to change the default upload directory from the Administration page.

WordPress Old Media Settings (Administration Dashboard)

Not sure why it was taken out in the first place, fortunately there’s still a way to do it without too much trouble.

You just need to add the following code in the wp-config.php file:

// Change default upload directory to '/myimages'
define( 'UPLOADS', 'myimages' );

The example above is based on the assumption that you want your upload directory in a sub-folder called ‘/myimages’ at the root of your WordPress installation. If you prefer to do it within your wp-content folder, make sure you include the path in the prefix:

// Change default upload directory to 'https://asset.itnota.com/wp-content/myimages'
define( 'UPLOADS', 'wp-content/myimages' );

Note: The above code needs to be added before the last section of wp-config.php that says:

/** Sets up WordPress vars and included files. */
require_once( ABSPATH . 'wp-settings.php' );

Further Reading

Editing wp-config.php: Moving Upload Folders

February 17, 2014 Filed Under: WordPress Tagged With: PHP

Comments

  1. Jacob says

    June 13, 2014 at 11:09 pm

    Hi, I add the code as your informed. And the file url did changed to my desired path. But the file could not be opened and seen, after upload.
    After that failed, I also tried to change the settings on “setting>media>Store uploads in this folder” to new path at the same time. Still the uploaded media could not be opened.
    Any way to solve that please?
    thank you.

    Reply

Leave a Reply Cancel reply

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

Buy me a coffee Support this site
Buy Me a Coffee?

Categories

  • .NET
  • Coding
  • Cybersecurity
  • Database
  • How To
  • Internet
  • Multimedia
  • Photography
  • Programming
  • Resources
  • Review
  • Tips and Tricks
  • Use Case
  • WordPress
  • Writing

Recent Posts

  • How to Check Installed .NET Framework Version
  • How to Remove .NET Runtime and SDK on Mac
  • How to Solve Intermittent 403 Error in IIS
  • How to Show Hidden Folders and Files in Mac Finder
  • How to Solve MS Office VBA Compile Error UserAuthentication

Recent Posts

  • How to Check Installed .NET Framework Version
  • How to Remove .NET Runtime and SDK on Mac
  • How to Solve Intermittent 403 Error in IIS
  • How to Show Hidden Folders and Files in Mac Finder
  • How to Solve MS Office VBA Compile Error UserAuthentication
  • RSS

Tags

.NET Access AdSense ASP.NET Cdonts Dll Classic ASP Code Editor ETL FSharp Genesis Framework Git Google HP Asset Manager HTML HTML5 Hugo IIS Information Security Internet Internet Information Services iOS JAMStack Linux macOS Microsoft Microsoft SQL Server MVC PHP Python Simple Mail Transfer Protocol Smtp Server Social Media SQL SQL Server SSIS SSMS SSRS Sublime Text Visual Studio Visual Studio Code VPN Windows Windows 8 Windows 10 Windows Server

Copyright © 2011-2022 IT Nota. All rights reserved. Terms of Use | Privacy Policy | Disclosure