Hide signs of original theme (sounds pretty dumb, right?)

Hi!

There's a thing that I've been wondering lately about WordPress. So, the thing that I'm interested in achieving is hiding the theme name in source code for all pages, posts etc. I'm using the Herald theme and that word "Herald" is all over source codes for each page and posts. This is quite regular, I know, but maybe it's possible to change those, so when somebody takes a peek in source code, then they would see just that this is for example theme, which has the same name as my site. I guess just replacing those theme names in source codes would give lot errors, so I'm here. Maybe you, WordPress so-called Superheroes can help me with that?

My site name starts with k (support staff can find full address/name). I don't want that anyone would know about this, who knows about WordPress and my site :slight_smile:

Thanks and greetings
Andri

  • Adam Czajczyk

    Hello Andri,

    I hope you're well today and thank you for your question!

    You may "hide" the "original theme" by modifying it slightly. It shouldn't break your site but will disable updates for the theme and also I'm not quite sure if it won't break licence. I'm not referring to a "legal" side of it as it's not for me to judge whether it's legal or not but to a "technical" side: I can see that this is a premium theme so if a licence is needed for it to function properly such a change may break it. You'll however find out about it after you give it a try.

    That said, you will want to make following changes:

    1. Edit the "style.css" file that's located in a main folder of your current theme ("/wp-content/themes/some-theme/"); there's should be a code similar to this at the top of it:

    Theme Name: SOME THEME
    Theme URI: http://somethemesiteurl.com
    Description: Theme Description
    Author: THEME AUTHOR NAME
    Author URI: http://somethemeauthorurl.com

    You'll want to replace theme name, theme URI, author and author URI values (strings after ":") with your own custom values; Once this is done save the file.

    2. Rename the theme folder ("/wp-content/themes/some-theme")

    It would be best to switch to other theme before making these changes. After you make them, the "original" theme should disappear from your theme selection in site's dashboard and appear under custom name. If a theme is written according to WordPress Codex standards you should be able to enabled it back and it should work fine.

    Best regards,
    Adam

  • Andri

    Thank you for your reply! Yes, I've done that with changing the name in CSS file, but when to open one blog post or page and look it's source, then the theme name is all over CSS scripts, which are visible there. I'm already using this plugin, but it doesn't hide theme name in page source. The theme name is there like 200 times or more.

    Here is one example of code that is visible when checking out source code and it contains theme name "herald", as you can see.

  • Adam Czajczyk

    Hello Andri!

    That part of code that you shared explains a lot. It seems that the theme is written that way to include theme name in a "source". It's actually quite a "good practice" to use theme/plugin name as part of element's ID/class name as it makes it unique and easy to address.

    Unfortunately, it doesn't make it easy to "hide" original theme at all. In my opinion, your only option here would be to review file-by-file line-by-line and change all the IDs and class names. It's a daunting task as there seems to be a lot of those and also it's extremely easy to make a mistake.

    You could use any text-based "bulk search-and-replace" tool to "automate" that task a bit and simply replace all occurrences of e.g. "herald-" and "herald_" strings but still - it may replace "too much" so you may need to review and "fix" such a changed theme manually.

    Kind regards,
    Adam

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.