Reader voting on docs

Every doc displays an upvote and a downvote button at the bottom of the article. Visitors do not need an account to vote; one vote per browser is enforced via a cookie.

How votes are stored

Each vote is stored as post meta on the doc. The total upvote and downvote counts are exposed:

  • In the admin doc list (sortable columns).
  • Through the REST endpoint POST /wp-json/helpwp/v1/docs/{id}/vote which both adds a vote and returns the new totals.

The plugin does not record who voted, an IP, or any reader identifier. The cookie is used purely to prevent the same browser from voting twice.

Using the data

Votes are a quick proxy for “is this article helping people?”. Two practical workflows:

  • Spot articles to rewrite. Sort the doc list by downvotes descending and rewrite the worst-performing ones.
  • Surface the best articles. Sort by upvotes descending to feature top-rated docs in your home page or onboarding flow.

The vote endpoint is open by design (anyone, logged in or not). If you need stricter control, use the rest_request_after_callbacks filter to layer on your own validation.

Resetting votes

Votes are post meta, so a SQL query against wp_postmeta for _helpwp_doc_upvotes / _helpwp_doc_downvotes will reset them. Or simply trash and restore the doc; vote counts are kept on trash and reappear on restore unless the post is permanently deleted.

Was this doc helpful?

Scroll to Top