Maciek Tracz
Maciek Tracz

Reputation: 1

Link description of Wordpress site on discord

I encountered a problem while sending a link to my new Wordpress site to a friend. While the link on every other platform shows exactly the same description, as it should. Discord, on the other hand, puts author above description so that when the link is sent it sais:

[mydomain.com]

admin

[description]

It is not that much of a problem but I think that it should not take a place, especially when I often link lot of things on discord.

Upvotes: 0

Views: 2687

Answers (1)

Owen Roots
Owen Roots

Reputation: 11

Adding this block of code to your wordpress functions.php (use child theme if necessary)

This is the shortest method of removing the data that discord pulls in though it will remove the data from being view from every site that wants to embed a link.

/* Disable oEmbeds author name & author url ~ Stops Showing in embeds */
add_filter( 'oembed_response_data', 'disable_embeds_filter_oembed_response_data_' );
function disable_embeds_filter_oembed_response_data_( $data ) {
    unset($data['author_url']);
    unset($data['author_name']);
    return $data;
}
  • Note this was taken from another post on stackOverflow and isnt my own code : there is also a more compliacted solution on this thread as well. original post

This can also have so negative effects on SEO due to not sharing the data, and we all know google loves data.

An alternative solution is to set the author of the post to the site name rather than the admin user.

  • Side note you really should change your username from admin to something less generic so a potentual hacker has to work out the username as well as the password.

Upvotes: 1

Related Questions