Depending a the user’s permissions, WordPress will whitelist certain html elements and attributes and then remove those elements/attributes not found in the whitelist before it saves to the database.
To add a “data-timestamp” attribute to an anchor (link) tag try adding this code to your theme’s functions.php:
function add_data_timestamp_attribute_to_anchor( $tags, $context ) {
if ( 'post' !== $context && ! in_array( 'post', $context ) ) {
return $tags;
}
$tags['a']['data-timestamp'] = true;
return $tags;
}
add_filter( 'wp_kses_allowed_html', 'add_data_timestamp_attribute_to_anchor', 10, 2 );
PS To have your code appear as text you need to surround the code with a “backtick” mark on each side (press the code
button on top of the textarea to add one automatically).