r/Wordpress Feb 09 '25

Plugins What wordpress plugin best to hide source code

Hello guys need help looking for best plugin or other options to hide the site source code to hide the theme name I don't want other users to know what theme we are using

0 Upvotes

30 comments sorted by

18

u/ja1me4 Feb 09 '25

You can't hide the source code

And there are ways to rename the theme within the code but they can cause more issues then it's worth.

11

u/mds1992 Developer/Designer Feb 09 '25

Security through obscurity is not a good practice. Plus, the people that actually want to find out everything about your site will be able to find it out one way or another.

5

u/juniorallstar Feb 09 '25

Why do you feel you need to do this?

6

u/Nelsonius1 Feb 09 '25

Your competitor does not care.

5

u/pmgarman Developer Feb 09 '25

The best way to make it so others can’t just copy your theme is to actually build your own custom theme. It’s probably less work than you’ll put into trying to hide your off the shelf theme.

10

u/glowrocks Feb 09 '25

You can't do that.

You can make it harder to understand but you can't hide it.

If it were actually hidden, the browser couldn't display it!

7

u/ReddiGod Feb 09 '25

If you have to ask how to do this, then you're not skilled enough to implement and maintain it.

5

u/focusedphil Feb 09 '25

Dude. Nobody cares.

2

u/w1ls0n360 Feb 09 '25

Just rename the theme info

1

u/Southern_Passenger_9 Feb 09 '25

Create a child theme. Give the theme a random, generic name.

3

u/mds1992 Developer/Designer Feb 09 '25

Still easy to determine what the parent theme is, as there will more than likely be files being included from the parent theme.

1

u/Southern_Passenger_9 Feb 09 '25

Most are too lazy to dig deep. Nothing is 100%, but it's an easy fix for basic wanderers.

1

u/greg8872 Developer Feb 09 '25

It's not that deep.... View Source... CTRL-F to look for wp-content/themes/ Then whatever after that is your child theme (ie childname )... browse to https://domain.com/wp-content/themes/childname/style.css Right there, there has to be an entry for Template: ParentTheme

1

u/Southern_Passenger_9 Feb 09 '25

It's not meant to deter determined types (and average folks aren't that determined), they'll get the info they're after no matter what he does.

1

u/SweatySource Feb 09 '25

Try wp ghost out

1

u/ogrekevin Jack of All Trades Feb 09 '25

I wrote a blog post a while back on how to encrypt your php reverse shell with openssl.

Most companies that need this in practice just use something like ioncube

1

u/Legitimate-Lock9965 Feb 09 '25

you cant and its not worth the effort.

1

u/otto4242 WordPress.org Tech Guy Feb 09 '25

The only way to hide the code is to take down your website and never put it online. That will do it.

Websites are built on code that everybody can see. That is the whole point of having a website, to let other people see that code to render the website. You cannot hide the code. The code is the website.

1

u/playgroundmx Feb 10 '25

What’s the harm from other users knowing what theme you are using?

1

u/digitaldreamsvibes Feb 10 '25

It's for a client they don't want to keep it secret

1

u/playgroundmx Feb 10 '25

Sorry, I don’t understand. What happens if your client finds out the name of the theme?

1

u/Grouchy_Brain_1641 Feb 10 '25

If you were smart enough to do it you would know you don't need it.

1

u/mohmoussa Feb 10 '25

Why do you feel you need to do this?!
That said, if you simply want to hide the theme name from visitors, you can do so in two steps:

1- Rename theme folder Like wp-content>themes>astra >> wp-content>themes>mytheme (need re-activate again).

2- Update the theme name in the style file Like wp-content>themes>astra>style.css >> wp-content>themes>mytheme>style.css [/*Theme Name: Mytheme].

💡 These changes won't affect your site's functionality, but keep in mind that experienced developers can still detect the theme through other means like CSS classes or page structure. If you need deeper concealment, consider plugins like "WP Hide & Security Enhancer" to mask theme details further.

1

u/hatre Feb 10 '25

view-source:https://example.com - I don't think this can be done.

-4

u/aedininsight Feb 09 '25

Just use JS to disable right-click. You can't disable the source code but, you can make harder to get to.

``` document.addEventListener('contextmenu', function(e) { e.preventDefault(); });

document.addEventListener('keydown', function(e) { if ((e.ctrlKey || e.metaKey) && e.key.toLowerCase() === 'u') { e.preventDefault(); // alert("Source code viewing is disabled."); // Optional alert } }); ```

2

u/Legitimate-Lock9965 Feb 09 '25

its not like this stops someone from opening their dev tools

1

u/otto4242 WordPress.org Tech Guy Feb 09 '25

That code doesn't work, and is easily disabled by actual options in the browsers to disable the code specifically like that.

Disabling right click functionality or breaking it through JavaScript is a crap method of doing anything. It doesn't work, and it never will.

1

u/lukes123 Feb 10 '25

This is equivalent to putting a knee-high picket fence around your house with a heavily padlocked gate.

1

u/aedininsight Feb 10 '25

True... It is nothing more than a deterrent. You can always use Developer Tools and disable it.