0

How can I change the default "/wp-content/" folder name in WordPress by typing a plugin or using our theme's "functions.php" file?

This is possible with the "wp-config.php" file. But I want it to be permanent, and I want the new name I set to be permanent whenever an update arrives. Is it possible to do this? Thank you.

wp-config.php

//Rename wp-content folder
define ('WP_CONTENT_FOLDERNAME', 'Folder_Name');
0

wp-config.php changes are persistent and should not be overwritten by updates.

Of course, there are ways to write to this file programmatically - which you could no doubt do from a plugin, but that's really not the intended use - it's designed more or less to hold settings which change very infrequently.

Perhaps you also need to edit another constant to get this working correctly, but I'm not certain this is required:

define('WP_CONTENT_FOLDERNAME', 'Folder_Name');
define('WP_CONTENT_DIR', ABSPATH . WP_CONTENT_FOLDERNAME);

Note that you OS might also by case sensitive, or not..

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.