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.

1–24 of 72 snippets “tools”

  • PHP Users

    "Delete My Account" Request Button

    Adds a [wpide_delete_account] shortcode with a button that files an erasure request in WordPress's privacy tools; the member confirms by email and you process it under Tools > Erase Personal Data.

  • PHP Accessibility

    Accessibility Report for All Posts and Pages

    Adds Tools > Accessibility Report, which checks your published posts and pages for images without alt text, empty links, iframes without titles and skipped heading levels, and lists each problem with an edit link.

  • PHP Security

    Activity Log in Its Own Database Table

    Records logins, failed logins, content changes, plugin, theme and user changes and edits to key settings in a dedicated database table, with a searchable, paginated log under Tools > Activity Log and automatic cleanup.

  • PHP Developer

    Add a Custom WP-CLI Command

    Registers a "wp site-stats" WP-CLI command that prints counts of posts, pages, comments and users, as a template for your own command-line tools.

  • PHP Performance

    Auto-Drafts and Trash Cleanup Tool

    Adds Tools > Clean Up Drafts and Trash with counts of leftover auto-drafts, trashed posts and trashed or spam comments, and a button to remove them all permanently after confirmation.

  • PHP Performance

    Autoloaded Options Inspector

    Adds Tools > Autoloaded Options showing the total size of options WordPress loads on every page and the 40 largest ones, with a button to stop autoloading any option that does not need it.

  • PHP Block Editor

    Block Usage Report Under Tools

    Adds a Tools > Block Usage screen counting how many posts and pages use each block, with a link to the content using it, so you know which blocks and plugins are safe to remove.

  • PHP Accessibility

    Color Contrast Checker Under Tools

    Adds a Tools > Contrast Checker page where you pick a text and background color and instantly see the WCAG contrast ratio and whether it passes AA and AAA for normal and large text.

  • PHP Privacy & Cookies

    Records each cookie consent choice (accepted or rejected, categories, date and privacy policy version) in its own database table, with only a shortened IP address, and lists the latest records under Tools > Consent Log.

  • PHP Developer

    Content Types Overview Screen

    Adds Tools > Content Types, a table of every registered post type and taxonomy with its labels, visibility, archive, REST base, URL slug and item count.

  • PHP RSS Feeds

    Custom Field Values in Feed Items

    Adds the custom fields you choose, such as an event date or location, to each RSS item as its own element, for newsletter tools, aggregators and partner sites that read your feed.

  • PHP Performance

    Database Table Sizes and Optimize Buttons

    Adds Tools > Database Tables listing every table of your site with its row count, data and index size and reclaimable space, sorted by size, with an Optimize button for tables that need it.

  • PHP Performance

    Delete Image Size Files No Longer Registered

    Adds Tools > Unused Image Sizes, which finds resized copies of your images made for sizes your current theme and plugins no longer register, shows how much space they take, and deletes them in batches after confirmation.

  • PHP Email

    Email Log Under Tools

    Keeps a list of the last 100 emails the site tried to send (date, recipient, subject and whether it failed) and shows it under Tools > Email Log.

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.