Encoding Contact Data with a Shortcode and Hook for Third-Party Plugins

This article explains how to use the CleanTalk shortcode and hook features to encode and protect contact data. This is especially useful for web developers and site owners who want to hide sensitive information (such as emails or other contact details) from bots while allowing legitimate users to access the information when needed.

Even if the main encoding option is turned off, CleanTalk offers alternative encoding methods via shortcodes and hooks:

1. Using the Shortcode
Add [apbct_encode_data]any text to encode[/apbct_encode_data] directly into your content using the visual editor. This will encode the specified text so it appears hidden to bots on the public site. Legitimate users can decode the information by clicking on it, similar to encoded email links.


2. Using the Hook
For developers, the hook apbct_encode_data provides a flexible way to encode any data from source code. Wrap any text you want to encode with this hook, like so:
$encoded_text = apply_filters('apbct_encode_data', 'any text to encode');

The $encoded_text variable will contain the encoded version of "any text to encode". Display this variable on the page, and it will be accessible to users by click, while remaining hidden from bots.

By using these methods, you can control which information is visible to bots and ensure legitimate users can access encoded contact data safely.

Was this information helpful?

It would also be interesting

Copied to clipboard