Hide message saying a comment has been removed

If a comment has been removed, I think it’d be best to not render this:

Screen Shot 2022-09-10 at 2.27.33 pm

Other platforms do this, such as YouTube. Otherwise it can pollute the comments section.

This is especially true when testing. I’ve made a bunch of comments during testing, but I’d like this message of them having being deleted to not render.

Or at least provide an option to hide a comment whilst deleting it, so the user can choose what they’d like to do. e.g if that comment has replies, the user may choose to still keep those replies by not hiding the comment.

If you can figure out the HTML class or id of the above element using the Developer Tools (right click > inspect) then you can inject JavaScript code in Settings > Code Injection > Site Footer to hide the above message.

Here’s some sample JavaScript code I use to hide certain elements on my website.

<script type="text/javascript">
    document.addEventListener("DOMContentLoaded", ready);

    function ready() {
        document.querySelector(".gh-article-label").remove();
    }
</script>

Hope it helps. Let me know if you have any questions.

Regards,
Akshay

2 Likes