Would like to remove <dc:creator>
or edit it to be a static value without editing core WordPress files. Preferably as a function.
Leave a Reply
You must be logged in to post a comment.
Would like to remove <dc:creator>
or edit it to be a static value without editing core WordPress files. Preferably as a function.
You must be logged in to post a comment.
Copy
/wp-includes/feed-rss2.php
to your theme folderEdit it and make whatever changes you desire (e.g. removing the line for
dc:creator
)in your theme’s
functions.php
file, add the following function:Edit by Otto: While that will work, this would be a better way:
The
add_feed()
function is smart, and will handle the actions and such for you.Note: It will require a one-time use of
flush_rules()
to take effect.I was going to use the above answer from Otto but the more I looked at the templates the more it dawned on me that you don’t need all that.
Just hook
the_author
filter and checkis_feed
if you want a RSS specific author.We were unable to get any of the other answers to this question to work for us. Maybe it was due to the theme we’re using.
@Biranit Goren’s solution resulted in a 500 error when we tried to load our RSS feed.
@jgraup’s solution does work, but the Author field in all of our views for posts, pages, events, media library, etc. show as blank when we use the code in our functions.php file.
We did find the following, which worked. Credit goes to the following article: https://www.flynsarmy.com/2013/10/add-to-or-override-the-default-wordpress-rss-feed/
Copy the feed-rss2.php from the wp-includes directory to your child theme directory.
Modify the feed-rss2.php in your child theme’s diectory as desired.
Add the following to your child themeâs functions.php file
For those who don’t want to do a PHP script hack. The field simply displays the author name of the post. If you want to change what it says, go to the WP admin, then go to ‘Users’ -> ‘Your Profile’ (or go to the specific user you want to change). Then change the field ‘Display name publicly as’ to what you want to show in the RSS feed.
Unfortunately, that element is hard-coded into WordPress core. Take a look at
/wp-includes/feed-rss2.php
: