melvinsalas

Disabling Bear's upvote-button

3 ways to disable the Bearblog vote button:


TLDR: make_discoverable > false


1. CSS

This is the most hackable option, since anyone who changes the CSS from the browse's element inspector can do it in two clicks. Basically, by using the form's ID and marking it as important, the button won't appear anymore.

#upvote-form {
  display: none !important;
}

2. Script

This one's a bit more complex: it’s a script that waits for the page to load, disables the elements, then disables clicking and prevents it from reappearing. This code goes in the Settings > Header and footer directives, it can be in the head or footer, doesn’t matter.

<script>
  document.addEventListener("DOMContentLoaded", () => {
    const remove = () =>
      document.querySelectorAll('[class*="upvote-button"],[id*="upvote-button"],upvote-button')
        .forEach(el => el.remove());

    remove();
    if (window.upvoteButton) window.upvoteButton = () => false;

    new MutationObserver(remove).observe(document.body, { childList: true, subtree: true });
  });
</script>

3. Attributes

The first two disable the button, but the article will still appear in Bearblog's feed. If you don't want either, simply use the make_discoverable: false flag in the post. This is a perfect fix because it prevents Bearblog from injecting the vote button script altogether. I highly recommend it for listings or standalone pages.


That's it! I hope this helps!

#2025 #english