Categories: Blog

How to rename your wp-content Directory

Secure your WordPress site by renaming wp-content

Some bloggers running WP want to add one more security layer and hide their wp-content from script kiddies by renaming to wp-content2 or to whatever they wish to.

If you want to join them follow my short guide below:

Access your wp-config.php located in the root of your WP site and edit it by adding the following lines:

define ('WP_CONTENT_DIR','/full/path/to/your/content/dir');
 define ('WP_CONTENT_URL','http://example.com/full/path/to/your/content/dirs/url');

Then Save and Refresh.

If you just installed WP then this is the only thing you have to do, on the other hand if your site was already alive and kickin then you should go and update all of your posts that host media uploaded via the WP Media Manager.

This extra step is necessary because when a media file(for ex. an image) is attached to any of your posts then its stored by default to the wp-content directory so if you rename that directory then all of your posts should be updated with the new path that hosts the attached media.

Read more constants about WordPress Configuration

CAUTION: Changing your wp-content directory name will break your plugins too so you may need to re-install them, moreover you may as well experience issues when installing new plugins.
Makis Mourelatos

WC Athens 2016 co-organizer, WP Support and Security Aficionado, Wannabe Kitesurfer.

Share
Published by
Makis Mourelatos

Recent Posts

WordPress Theme Development

WordPress is a widely popular Content Management System (CMS) that powers over 40% of all…

1 year ago

WordPress Solutions

WordPress is a popular platform that empowers more than 60 million websites worldwide. Millions of…

1 year ago

WordPress Site Maintenance

In this article, we will cover ten crucial WordPress site maintenance tasks that every website…

1 year ago

WordPress Security Solutions

In this blog article, we will explore the various WordPress security solutions you can implement…

1 year ago

WordPress Plugin Solutions

Plugins are an integral part of WordPress, as they offer countless benefits and features that…

1 year ago

WordPress Optimization and Performance Improvement

In this article, we will explore various strategies that can help you enhance your WordPress…

1 year ago