Halloween Sale 15% off Ends in See the plans

Snippet Library

WordPress code snippets, ready to use

3,040 free snippets from the WPIDE team and the community. Copy the code, or add any snippet to your site in one click with WPIDE.

25–38 of 38 snippets “views”

  • PHP Media

    Search Media by Alt Text Too

    Makes the Media Library search, in both the grid and list views and the media picker, also match images by their alt text, which often describes the image better than the file name.

  • PHP Block Editor

    Search Result Preview in the Block Editor

    Adds a panel to the editor sidebar that previews how the post may look as a search engine result, with its title, address and description, updating live as you edit the title and excerpt.

  • PHP Content

    Simple Post Views Counter

    Counts how many times each blog post is viewed, shows the total in a Views column in the posts list and adds a [post_views] shortcode for the front end.

  • PHP Forms

    Star Rating Field in Comments

    Adds an optional 1 to 5 star rating to the comment form, saves it with the comment and shows the stars above the comment text, for review-style posts.

  • PHP Content

    Star Rating Shortcode

    Adds a [star_rating] shortcode that shows a rating such as 4.5 out of 5 as stars, with half stars and a text label for screen readers, for reviews and comparison posts.

  • PHP Custom Post Types & Fields

    Testimonial Details Meta Box

    Adds fields for the customer name, role, company, website and a 1–5 star rating to testimonials, plus a [testimonial_details] shortcode for the attribution line.

  • PHP Custom Post Types & Fields

    Testimonials Post Type

    Registers a "Testimonials" post type for customer quotes, kept out of search and without single pages, ready to show with a shortcode or query block.

  • PHP Analytics & Tracking

    TikTok Pixel

    Adds the TikTok pixel to every public page and records page views, with an option to wait for cookie consent.

Have a snippet worth sharing?

Publish it to the library from WPIDE or right here. Sign in with any WordPress site that runs WPIDE, free or Pro. Public snippets are reviewed by the WPIDE team before they appear.