RalphTheWonderLlama
RalphTheWonderLlama

Reputation: 143

Possible to Obfuscate Plugin Directories in Wordpress?

Is it possible to rename or redirect the plugins/child[] directories to change plugin names for Google or source code view?

Wordpress obviously relies on wp-content and it's children to run, but I'm curious if it's possible to rename the children of plugins using .htaccess or another means.

I've experimented with variations this:

`Redirect 301 /path/to-old-url    http://www.yourdomain.com/path/to-new-url`

...but that comes back to an actual redirect header response which I can't have.

I'm hoping it can be done and still have Wordpress function and update themes and plugins normally, but I'm not that savvy using .htaccess and I've blanked my site several times trying different things.

Any pointers or help would be really appreciated. :)

EDIT: What I'm trying to do is change the visible plugin/child directory name only. Not change the directory Wordpress accesses for plugins/name - having the revised plugin/name visible is not a problem.

Upvotes: 1

Views: 1002

Answers (2)

Cypher
Cypher

Reputation: 258

Digging up this old thread. According to the wp-hide plugin documentation you can actually hide the plugin name itself (as of 2024).

Upvotes: 0

skladany
skladany

Reputation: 170

OK, add this in wp-config.php, and it should do what you need, replacing 'apps' with the directory you want to serve from, and moving the plugins to the same directory on the server.

define( 'WP_PLUGIN_DIR', $_SERVER['DOCUMENT_ROOT'] . '/apps' ); define( 'WP_PLUGIN_URL', 'http://' . $_SERVER['HTTP_HOST'] . '/apps' );


(Initial responses before fully understanding the question.)

Not really.

You could use this WP Hide & Security to hide the plugin path /wp-content/plugins/ and rewrite that to something else, e.g., /apps/ ...but the NAMES of the plugins would still be visible.

The only way I could think of not showing the plugin names would be to directly include them in your theme via php includes, and strip out all the css/js that the plugin adds and incorporate that into your theme.

However, that likely would break the plugin, and even if you could get it working correctly, there would be now way to update said plugin in the future....(and of course that would make your site terribly hard to support so it's not recommended at all.)

Upvotes: 1

Related Questions