WordPress.org

Ready to get started?Download WordPress

Forums

Rename WP-Content (WP 3.X) (4 posts)

  1. Meyuk
    Member
    Posted 2 years ago #

    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
    Meyuk

  2. 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.

  3. Meyuk
    Member
    Posted 2 years ago #

    Thanks Jan. This one removes/replaces the "wp-content"? Because I do not want that in source-code.

    Where should I replace this?

  4. 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.

Topic Closed

This topic has been closed to new replies.

About this Topic