Home › Forums › Support › How to remove Author Tag from being visible in Discord’s previews and others?
- This topic has 14 replies, 2 voices, and was last updated 3 years, 5 months ago by
Leo.
-
AuthorPosts
-
November 7, 2022 at 2:31 pm #2405405
Enrique
Hi there,
When linking my website in Discord I noticed that it shows an author tag. When trying to find a solution for hiding it I found these topics:
https://wpdatatables.com/how-to-hide-the-author-in-wordpress/
But when trying to find the code in GeneratePress theme file editor, I don’t seem to be able to locate it.
Is there a workaround for this within the GP premium theme?
Thanks in advance.
November 7, 2022 at 2:40 pm #2405412Leo
StaffCustomer SupportHi there,
I don’t believe that the GP has anything to do with this but let’s check.
Does the code work if you activate a Twenty series WP theme to test?
Let me know 🙂
November 7, 2022 at 2:42 pm #2405413Enrique
Yes, it works on those themes since they include the code to be modified at their theme .php files. The thing is, GP doesn’t seem to include this “posted by” code so I could empty it as shown in the examples like this:
function twentynineteen_posted_by() { } endif;Or I don’t know in which GP theme file it’s located.
November 7, 2022 at 4:07 pm #2405467Enrique
I’ve found this old support topic:
https://generatepress.com/forums/topic/cannot-redeclare-function-generate_posted_on-error/
Seems to be a similar issue about trying to edit this type of theme functions.
Not sure if we could get the desired results with these type of functions from GP:
https://docs.generatepress.com/article/generate_post_date_output/#only-show-updated-date
These are author related ones:
https://docs.generatepress.com/article/generate_post_author_output/
https://docs.generatepress.com/article/generate_post_author/
November 7, 2022 at 4:11 pm #2405469Enrique
And there’s also these blog related topics:
https://docs.generatepress.com/article/generate_header_entry_meta_items/
https://docs.generatepress.com/article/option_generate_blog_settings/
https://docs.generatepress.com/article/blog-content-layout/
Would like to know what exactly to edit for the desired result, thanks.
November 7, 2022 at 4:14 pm #2405470Enrique
My guess is that it should have to do with “generate_post_author_output”. If it’s the case, in which theme file is it located?
November 7, 2022 at 4:15 pm #2405471Leo
StaffCustomer SupportAny chance you can link us to the page in question?
You can use the private information field:
https://docs.generatepress.com/article/using-the-premium-support-forum/#private-informationLet me know 🙂
November 7, 2022 at 4:19 pm #2405477Enrique
Sent.
Basically, what I need is that, when the link is sent to someone through the Discord app or any other app that gets similar tags from web pages, it doesn’t show my admin username or any other author’s name.
November 7, 2022 at 4:28 pm #2405480Leo
StaffCustomer SupportIs there a specific page/post we should be looking at?
And can you show me a screenshot of exactly what you are referring to?
https://docs.generatepress.com/article/using-the-premium-support-forum/#uploading-screenshotsNovember 7, 2022 at 4:39 pm #2405492Enrique
Image sent.
November 7, 2022 at 4:59 pm #2405511Enrique
Sent another screenshot example showing how your website doesn’t show any user tags.
November 7, 2022 at 5:10 pm #2405520Leo
StaffCustomer SupportWe are not doing anything special on our site.
Can you try this PHP snippet:
add_filter( 'generate_post_author', '__return_false' );November 7, 2022 at 5:21 pm #2405528Leo
StaffCustomer SupportIf not then this is the function you are looking for I believe:
https://github.com/tomusborne/generatepress/blob/4895a2e7595bb809075b375201fd735112f41570/inc/structure/post-meta.php#L216It has a filter you can modify:
https://docs.generatepress.com/article/generate_post_author_output/November 7, 2022 at 5:35 pm #2405533Enrique
Using the Code Snippets plugin, I was able to solve the issue by adding your PHP function. I have to say that at first, it didn’t work but I understand that these changes take a little to show up, however, it all worked when I added another function related to the oEmbed filter.
I used the StackOverflow suggested code:
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; }And now the author tag is not showing in the Discord chatrooms.
November 7, 2022 at 5:38 pm #2405535Leo
StaffCustomer SupportGlad to hear.
Thanks for sharing!
-
AuthorPosts
- You must be logged in to reply to this topic.