Moderator
Jan Dembowski
(@jdembowski)
Forum Moderator and Brute Squad
This just worked for me.
http://codex.wordpress.org/Editing_wp-config.php#Moving_wp-content
define( 'WP_CONTENT_DIR', $_SERVER['DOCUMENT_ROOT'] . '/jan-content' );
define( 'WP_CONTENT_URL', 'http://my-crash-test-dummy/jan-content');
However the existing post media will still reference the old wp-content
location. You’ll need to search and replace those if you want them changed too.
Thread Starter
Meyuk
(@meyuk)
Thanks Jan. This one removes/replaces the “wp-content”? Because I do not want that in source-code.
Where should I replace this?
Moderator
Jan Dembowski
(@jdembowski)
Forum Moderator and Brute Squad
If your read the link I posted you may see that it goes into your copy of wp-config.php
right above the line that says /* That's all, stop editing! Happy blogging. */
… 😉
Make a backup copy of your wp-config.php
file first before you edit it.
This one removes/replaces the “wp-content”?
What those two lines will do is replace wp-content in the HTML source with the new one (in my example I used jan-content
).
The caveats are
– It will not do anything for old post media links. I wouldn’t delete the old directory, you may break things.
– The replacement wp-content
must have all the old data or your theme, plugins, etc. will die a gruesome 404 file not found death. Before I did my test I duplicated all of the files and directories in wp-content
into jan-content
.
– All of your plugins and themes must honor those constants. Not all of them do.
– If you’re doing this for (imaginary, non-existent, complete waste of time) security reasons then don’t. It will do nothing for that.