Was having a hard time finding code injection that removed all author information site-wide for Casper theme (name, avatar, publish date), but after inspecting the theme’s code and finding some suggestions that worked partially, I was able to frankenstein a few things together and got it to work. I also included my process at the very bottom in case the code below doesn’t work with other themes. Hopefully it’s helpful to someone digging around for answers like I was.
Cheers,
Ruby
Go to settings → code injection → paste into site header
<style>
.article-byline, /* removes date */
.author-list, /* removes author avatar */
.author-name, /* removes author name */
.post-card-byline-content span:first-of-type {
display: none;
}
.post-card-byline-content {
margin-left: 0;
}
</style>
Process
I found suggestions in a few other threads that hid the author name and avatar, but unfortunately didn’t remove the publish date. (below)
(only removes author avatar + name)
<style>
.author-list, /* removes author avatar */
.author-name, /* removes author name */
.post-card-byline-content span:first-of-type {
display: none;
}
.post-card-byline-content {
margin-left: 0;
}
</style>
After confirming that the code injection removed the author name and avatar, I inspected the theme (using Chrome, go to a published page, right click and selected Inspect) to find what code the publish date was attached to.
I located the code that successfully hid the author name
<h4 class=“author-name”>
then I hovered over each bit of code until the publish date on the page was highlighted. I went to the top-most piece of code for the publish date
<divided class=“article-byline”>
and kinda just figured I’d try and apply the same logic from the author code to the publish date to see if it worked and it did. Not sure if I was just lucky but hopefully this helps someone else!