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.

169–192 of 285 snippets “code”

  • PHP Content

    PDF Viewer Shortcode

    Adds a [pdf_viewer] shortcode that shows a PDF from the Media Library or a URL inside the page with the browser's built-in viewer, plus a download link for phones that cannot display it inline.

  • PHP Privacy & Cookies

    Personal Data Request Form Shortcode

    Adds a [privacy_request_form] shortcode where visitors can ask for a copy of their personal data or for its deletion. Requests go into WordPress's own privacy tools and the visitor confirms by email.

  • PHP Custom Post Types & Fields

    Post Type Grid Shortcode

    Adds a [post_grid type="..."] shortcode that shows any post type as a responsive grid of cards with image, title and excerpt, so a regular page can act as its archive.

  • PHP Content

    Print Button Shortcode

    Adds a [print_button] shortcode that places a button visitors can click to print the current page, useful for recipes, guides and forms.

  • PHP Developer

    Private Log File Helper Function

    Adds a wpide_log() helper that writes timestamped messages and data to a daily log file in a protected folder inside uploads, so custom code can leave a trail without touching debug.log.

  • PHP Memberships

    Private Pages for Individual Members

    Adds a "Page owner" setting to pages so you can build a private page for one member or client; only that person and editors can open it, and a [wpide_my_pages] shortcode lists a member's pages.

  • PHP WooCommerce

    Product Price Shortcode

    Adds a [wpide_product_price id="123"] shortcode that prints the current price of any product, including sale formatting, inside posts and pages.

  • PHP Frontend & Design

    Progress Bar Shortcode

    Adds a [wpide_progress value="75" label="Funding goal"] shortcode that draws a labeled progress bar, for fundraising goals, skills or project status.

  • PHP Custom Post Types & Fields

    Property Details Meta Box

    Adds price, bedrooms, bathrooms, floor area and address fields to property listings and a [property_details] shortcode that shows them as a fact list.

  • PHP Custom Post Types & Fields

    Published Item Count Shortcode

    Adds a [post_count type="job"] shortcode that prints how many published items a post type has, for lines like "We have 12 open positions".

  • PHP Content

    Pull Quote Shortcode

    Adds a [pull_quote] shortcode that sets a short quotation in large type, floated to the side on wide screens and full width on phones, to break up long articles.

  • PHP Forms

    Quote Request Form Shortcode

    Adds a [wpide_quote_form] shortcode where visitors pick a service, budget and timeline and describe their project; requests are emailed to you with spam protection and rate limiting built in.

  • PHP Developer

    REST API Error Log Under Tools

    Records REST API requests that fail with a 4xx or 5xx status, with the route, method, user and error code, and lists the latest 100 under Tools > REST Errors for debugging integrations.

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.