Support » Fixing WordPress » Rename WP-Content (WP 3.X)

  • Hello,

    I want to rename “WP-Content” folder but I couldn’t find any resolution for this. I researched on Internet but didn’t found usefull articles. It’s excisting one article and it doesn’t work with WordPress 3.X versions. It would be great if someone could tell me how to rename.

    Thank you

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator Jan Dembowski


    Brute Squad and Volunteer Moderator

    This just worked for me.

    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.

    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


    Brute Squad and Volunteer Moderator

    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.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Rename WP-Content (WP 3.X)’ is closed to new replies.