Renaming wp-content folder dynamically

Is it possible to rename the wp-content folder dynamically? I am building a custom framework to use on themes and it would be nice to set it up where it does everything on its own.

I am using this following code right now in wp-config

Read More
define ('WP_CONTENT_DIR','/name_of_new_folder');
define('WP_CONTENT_URL','http://example.com/name_of_new_folder');

Can I pull the site domain through dynamically with PHP?

Related posts

Leave a Reply

2 comments

  1. Don’t do what seems to be possible…

    You can use the possibility to change the WordPress constants WP_CONTENT_DIR and WP_CONTENT_URL in your wp-config.php.

    BUT it really, really, really, really is not recommended.

    Why? not recommended??

    It’s pretty easy: Just do a cross file search (with your IDE or for e.g. Notepad++) for wp-content and you’ll find it hardcoded it many places. Some of the stuff will still work, but some wont. Yeah, I’ve already tried that.

  2. Figured it out!

    define('WP_CONTENT_DIR', ABSPATH . 'name_of_new_folder');
    define('WP_CONTENT_URL', 'http://'.$_SERVER['HTTP_HOST'].'/name_of_new_folder');