On plugin deactivation hide its shortcode

I’m afraid hiding the shortcode once the plugin is deactivated is simply not possible.

The only way to “hide” a shortcode from the content is to register the shortcode with a calback that returns nothing, as in:

add_shortcode( 'related', function(){ return null; } );

But of course you cannot do that without an active plugin.

Technically you could remove every occurence of the shortcode by pulling and editing all of the content that may contain it – but that would probably be a very bad idea, and this wouldn’t allow to get them back in case the plugin is reactivated.