Skip to content

Instantly share code, notes, and snippets.

View boogah's full-sized avatar
🎡

Jason Cosper boogah

🎡
View GitHub Profile

Disable Plugins

Quickly disable all plugins in WordPress.

Usage

This plugin needs to go into the wp-content/mu-plugins/ directory. Provided you have SSH access to the server where WordPress lives, you can do this:

cd $SITE_ROOT/wp-content/mu-plugins
@jonschr
jonschr / removeyoutuberelatedvideos
Created July 22, 2014 21:49
Remove related videos from youtube embeds (done via ooembed) in WordPress
//Remove related videos from youtube ooembed
add_filter('oembed_result', 'hide_youtube_related_videos', 10, 3);
function hide_youtube_related_videos($data, $url, $args = array()) {
$data = preg_replace('/(youtube\.com.*)(\?feature=oembed)(.*)/', '$1?' . apply_filters("hyrv_extra_querystring_parameters", "wmode=transparent&") . 'rel=0$3', $data);
return $data;
}
@johnbillion
johnbillion / wp_mail.md
Last active July 7, 2025 13:21
WordPress Emails

WordPress Emails

This document lists all the situations where WordPress sends an email, along with how to filter or disable each email.

This documentation has moved here: https://github.com/johnbillion/wp_mail

@krogsgard
krogsgard / template-file.php
Last active January 29, 2016 17:21
Stuff for wrangling Jetpack. End result is along these lines: https://cldup.com/8x050WNF_L.png
<?php echo krogs_output_related_posts(); ?>
<?php
/*
* Plugin Name: Remove crazy counts slowing down my dashboard
* Plugin URI: https://pmgarman.me
* Description: Those comment counts are such a pain when you have a lot of comments
* Author: Patrick Garman
* Author URI: https://pmgarman.me
* Version: 1.0.0
* License: GPLv2
*/
@joepie91
joepie91 / 1_changelog.md
Last active March 27, 2018 00:20
Remove Wired / V3 "ad-blocker veil"

Supported sites:

  • Wired
  • V3.co.uk

Requests for other sites are welcome (admin@cryto.net).

Changelog

  • July 25, 2016: Added support for V3.co.uk.
@norcross
norcross / disable-username-login.php
Last active July 11, 2017 19:44
Force a redirect if a certain username is attempted.
<?php
add_filter( 'authenticate', 'rkv_disable_username_logins', 20, 3 );
/**
* Disable admin username and redirect to Google (or another site).
*
* @param object $user The WP_User object.
* @param string $username The entered username.
* @param string $password The entered password.
*
@glaszig
glaszig / mkp2pblocklist
Last active January 30, 2022 00:30
creates a blocklist for your p2p endeavors
#!/usr/bin/env sh
# DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
# Version 2, December 2004
#
# Copyright (C) 2020 glaszig <glaszig@gmail.com>
#
# Everyone is permitted to copy and distribute verbatim or modified
# copies of this license document, and changing it is allowed as long
# as the name is changed.
@jenkoian
jenkoian / wp-plugin-mutation-test.sh
Created December 23, 2021 17:06
Small bash script to do some _very_ basic plugin mutation testing against a website. i.e. check the site doesn't fall over if a random plugin is deactivated.
#!/usr/bin/env bash
URL_TO_CHECK=${1}
if [ -z "$URL_TO_CHECK" ]; then
echo 'Please supply a URL'
exit 1;
fi
WP="wp"