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

Buy me a coffee?

Buy me a coffee If you find any of the articles or demos helpful, please consider supporting my work here, you'll have my big thanks!

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
  • Uncategorized
  • Use Case
  • WordPress
  • Writing

Recent Posts

  • ESP Work Automation: Empowering Enterprises with Streamlined Workflows and Operational Efficiency
  • How to Search for a String in All Tables in a Database
  • How to Install Cryptomator on macOS
  • How to Turn On Advanced Data Protection for iCloud
  • How to Create SSH Keys

Recent Posts

  • ESP Work Automation: Empowering Enterprises with Streamlined Workflows and Operational Efficiency
  • How to Search for a String in All Tables in a Database
  • How to Install Cryptomator on macOS
  • How to Turn On Advanced Data Protection for iCloud
  • How to Create SSH Keys

Tags

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

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