This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php // Do not copy opening php tag | |
/** | |
* Remove WooCommerce site visibility "Live" badge from the admin bar. | |
* | |
* @param WP_Admin_Bar $wp_admin_bar The WP_Admin_Bar instance, passed by reference. | |
*/ | |
add_action( 'admin_bar_menu', 'khp_remove_woocommerce_site_visibility_badge', 999 ); | |
function khp_remove_woocommerce_site_visibility_badge( $wp_admin_bar ) { | |
$wp_admin_bar->remove_node( 'woocommerce-site-visibility-badge' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* insert after gtag('config') */ | |
/* setTimeout("gtag('event', 'adjusted bounce rate', {'event_label':'More than 20 seconds'})",20000 ); */ | |
<!-- Global site tag (gtag.js) - Google Analytics --> | |
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-12345678-1"></script> | |
<script> | |
window.dataLayer = window.dataLayer || []; | |
function gtag(){dataLayer.push(arguments);} | |
gtag('js', new Date()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Sample code to run search & replace in your WordPress database from the command line with WP-CLI | |
# Use at your own risk! I make no warranties that this will actually work properly and not blow up your site! (I recommend trying this on a development server first.) | |
# Make a database backup first with "wp db export" | |
# Replace "domain.com" with your domain (also include www if used) | |
# https://developer.wordpress.org/cli/commands/search-replace/ | |
# Simple change from http to https | |
wp search-replace 'http://domain.com' 'https://domain.com' --skip-columns=guid | |
# Remove /year/month/ from permalinks |