admin管理员组

文章数量:1122832

How to hide the leading site url from the source code example

.css

Becomes

/wp-content/themes/themename/style.css

Removing the main site URL which / from the source code

I've seen many sites running wordpress however they don't have the Site URL shown in the source code for CSS and JS files.

I know there are many plugins that can help hiding wordpress source code so no one will know it's wordpress however none of them removes the Site URL from files links.

How to hide the leading site url from the source code example

http://example.com/wp-content/themes/themename/style.css

Becomes

/wp-content/themes/themename/style.css

Removing the main site URL which http://example.com/ from the source code

I've seen many sites running wordpress however they don't have the Site URL shown in the source code for CSS and JS files.

I know there are many plugins that can help hiding wordpress source code so no one will know it's wordpress however none of them removes the Site URL from files links.

Share Improve this question edited May 18, 2020 at 16:49 fuxia 107k38 gold badges255 silver badges459 bronze badges asked May 17, 2020 at 16:03 David BuikDavid Buik 1111 silver badge5 bronze badges 4
  • 2 Can I ask why you want this? – Jacob Peattie Commented May 17, 2020 at 16:49
  • I want this for many reasons, 1. to hide it's wordpress even if I'm using the plugins or hooks that help me do that however the structure of the CMS is still the same and still detectable. Second I want less load of the files to look as static HTML rather a CMS built website. – David Buik Commented May 17, 2020 at 20:15
  • Hiding the domain isn't going to hide that it's WordPress. wp-content is right there. – Jacob Peattie Commented May 18, 2020 at 1:02
  • True however the first step is hiding the domain and the second step using the plugins to mask urls – David Buik Commented May 18, 2020 at 1:25
Add a comment  | 

1 Answer 1

Reset to default 0

You can write your css codes inside php file, So your css file becomes style.css.php Then you can put it by include_once() in your theme So your css file will not be displayed in your page source code.

本文标签: pluginsHide Wordpress Site URL from Source Code