Halloween Sale 15% off Ends in See the plans

Snippet Library

Redirects snippets for WordPress

Snippets that send visitors where they should go: redirect after login or logout, from attachment pages, old URLs and empty searches, or to a maintenance page. Quick fixes when you only need a few redirects, not a redirection plugin.

1–3 of 3 snippets “blog”

  • PHP Redirects

    Fix URLs With Double Slashes

    Permanently redirects addresses that contain double slashes, such as /blog//my-post/, to the clean version, avoiding duplicate pages from broken links and badly built URLs.

  • PHP Redirects

    Redirect Trashed Posts to Their Category

    Remembers the address of each post or page you move to the trash and sends later visitors to its category, parent page or the blog page instead of a 404, even after the trash is emptied.

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.