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

By default you cannot access a file inside the theme folder directly from the browser, what changes should I make to make an exception?

share|improve this question
Just wondering why are you trying to access a file directly there? – Vince Pettit Aug 1 '12 at 13:24
My client requested it because he has a script that can only work on a non-wordpress file. I could simply put it in the root folder but I think it's not safe. – jilseego Aug 1 '12 at 13:27
a script that can only work on a non-wordpress file why would this be the case? – Milo Aug 1 '12 at 13:29
I honestly don't know. I didn't bother to ask. It's just an additional request that's not part of the initial agreement. :-O – jilseego Aug 1 '12 at 13:30
What does the script do? – Vince Pettit Aug 1 '12 at 13:34
up vote 3 down vote accepted

By default you cannot access a file inside the theme folder directly from the browser

But that's just not true.

share|improve this answer
This is true. Also, for the original question of the author, any HTML file (placed inside the theme folder) can be accessed directly from the browser. As per the .htaccess rules for WordPress permalink, any direct access to files isn't blocked. – Pothi Aug 2 '12 at 0:40

if you just embed it by iframe, what does it matter where it is located? put it in a designated folder for it.

Sounds like a horrible solution thou...

share|improve this answer
Well my assumption is that placing it along with most crucial files of Wordpress is not safe. Yeah it is. That's what my client wants and he knows it's a horrible solution. – jilseego Aug 1 '12 at 13:43
Why would it not be safe? if the 'billing' script just does what it does. – woony Aug 1 '12 at 13:46

Make a folder in the root of the site called /files and put it there instead.

share|improve this answer

You can access via the following method.


share|improve this answer
wp-content/themes might not even exist, because you can move that to a completely different domain. – toscho Apr 25 '14 at 10:56

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.