WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
up vote 3 down vote accepted

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.

share|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

share|improve this answer
while I agree, this is a comment and not an answer – Mark Kaplun Jul 8 at 19:45
@MarkKaplun thanks for downvoting . – tazo todua Jul 19 at 11:37

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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