![WordPress adds the author's name in the meta tag](https://zmingcx.com/wp-content/uploads/2bb76-0086QeOHly1gvyrs9pmj5j30xc09kadc.jpg)
WordPress adds the author's name in the meta tag
Adding a WordPress theme on meta property
When labeling, one of them is:
<meta property="og: author" content="author"/>
One question, the common WordPress codes on the Internet are:
<meta property="og:author" content="<?php the_author(); ?> " />
Including:
<? php the_author(); ?>
In this case, the author name cannot be displayed. If you don't know how to display the author name, it may be copied without knowing why.
Solution:
<? php the_author_meta('user_nicename', $post->post_author); ?>
Replace.
The default user_nicename is the login name of the author, which is dangerous to expose important information. It can be replaced with the following:
- Display_name Public display name
- User_nicename nickname
- First_name First Name
- Last_name Last Name
It is recommended to use: display_name, which is the name in the "Public Display" setting.
As for the complete meta property
The way to write tags is different because of different topics and different ways to obtain information. I will not write them here. I will search a lot on the Internet. If the author's name is not displayed, please change it.
Most of the articles on this site are original and used for personal learning records, which may be helpful to you, for reference only!