You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hide the “Optimized by Seraphinite Accelerator” badge in Wordprress. The snippet does two things:
Replies f to the plugin’s ?seraph_accel_gbnr probe so the badge removes itself.
As a fallback, strips any remaining banner markup from the final HTML.
Easiest way: MU-plugin (loads automatically)
Create the folder if it doesn’t exist:
wp-content/mu-plugins/
Create the file:
wp-content/mu-plugins/hide-seraphinite-banner.php
Paste this code and save:
<?php
/*** Plugin Name: Hide Seraphinite Accelerator Banner
* Description: Oculta el “Optimized by Seraphinite Accelerator”.
*/
// Responde al probe (?seraph_accel_gbnr) para que el propio script elimine el banner
add_action('init', function() {
if (isset($_GET['seraph_accel_gbnr'])) {
header('Content-Type: text/plain; charset=utf-8');
header('Cache-Control: no-store, max-age=0');echo'f';exit;
}
}, 0);
// Plan B: si igual aparece en el HTML final, lo borramos
add_filter('seraph_accel_content', function($html) {
$html = preg_replace('~<a[^>]*>(?:\s*<img[^>]*>)?\s*<span[^>]*>\s*Optimized by Seraphinite Accelerator\b.*?</a>~is', '', $html);$html = preg_replace('~<script[^>]*seraph-accel-crit="1"[^>]*>.*?\?seraph_accel_gbnr.*?</script>~is', '', $html);return$html;
}, 9999);