Here is what I am thinking of trying to hide wp-content from the urls of files included in page source.

defining the following in wp-settings.php

define ('WP_CONTENT_URL','http://example.com/myownfoldername');

and adding this to .htaccess

RewriteRule ^myownfoldername/(.*) /wp-content/$1 [QSA,L]

This seems to work fine with no additional plugins on localhost `but will it work seamlessly on the online site with a few plugins. I am more concerned about w3 total cache.

I guess I need now worry about a few reference of wp-content in database as even if it exists there it is still a valid link?


You don’t need a separate rule in your .htaccess. Add …


… to your wp-config.php. Do not write into wp-settings.php. This file will be overwritten during the next update – never touch a core file.

| improve this answer | |
  • In the WP_CONTENT_DIR I have to give path to original wp-content folder? – PRYM Dec 26 '11 at 23:58
  • Using WP_CONTENT_DIR, I have to rename the folder to the new directory name. But using .htaccess I can still have directory name as wp-content – PRYM Dec 27 '11 at 0:05


You will waste energy. it has no secruity. Read this - https://goo.gl/Pkq8Kn

| improve this answer | |
  • while I agree, this is a comment and not an answer – Mark Kaplun Jul 8 '16 at 19:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.