Skip to content

Instantly share code, notes, and snippets.

@amboutwe
amboutwe / yoast_seo_breadcrumb_remove_static_blog_page_only.php
Created May 12, 2021 22:46
Remove Yoast breadcrumb from static blog page
<?php
/********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/
/* Remove Yoast breadcrumb from static blog page
* Credit: Yoast team
* Last Tested: May 12, 2021 using Yoast SEO 16.2 on WordPress 5.7.1
*/
add_filter( 'wpseo_schema_webpage', 'remove_breadcrumb_schema_ref', 10, 1);
function remove_breadcrumb_schema_ref( $piece ){
function test_parse() {
var file = SpreadsheetApp.getActive();
var sheet = file.getSheetByName('Sheet1'); // change
var sets = {
rangeParse: sheet.getRange('L2:L16429'), // change
rangeResult: sheet.getRange("M2"), // change
func_parse: parseOkkoFilmToGetHorizontalPoster_ // change / create your function
};
parseUrls_(sets);
}
@tillkruss
tillkruss / ocp.sh
Last active October 25, 2024 23:23
cd ./wordpress
wget https://objectcache.pro/plugin/redis-cache-pro.zip?token=0000000000 | unzip
cp redis-cache-pro/stubs/mu-plugin.php wp-content/mu-plugins/redis-cache-pro.php
mv redis-cache-pro wp-content/mu-plugins
rm redis-cache-pro.zip
read -r -d '' WP_REDIS_CONFIG <<- EOM


Front-End Performance Checklist

Front-End Performance Checklist

🎮 The only Front-End Performance Checklist that runs faster than the others.

@hmowais
hmowais / functions.php
Last active January 25, 2025 01:18
Google Page Speed [Manual-Updated]
<?php
/* cleaup*/
remove_action( 'wp_head', 'feed_links_extra', 3 ); // Display the links to the extra feeds such as category feeds
remove_action( 'wp_head', 'feed_links', 2 ); // Display the links to the general feeds: Post and Comment Feed
remove_action( 'wp_head', 'rsd_link' ); // Display the link to the Really Simple Discovery service endpoint, EditURI link
remove_action( 'wp_head', 'wlwmanifest_link' ); // Display the link to the Windows Live Writer manifest file.
remove_action( 'wp_head', 'index_rel_link' ); // index link
remove_action( 'wp_head', 'parent_post_rel_link', 10, 0 ); // prev link
@jessedmatlock
jessedmatlock / WP HTML Sitemap code
Created April 13, 2021 15:26
Sitemap code for word press
<?php
/**
* Template Name: Sitemap
*/
get_header(); ?>
<?php if ($GLOBALS['$show_titles']){ echo '- Sitemap'; } ?>
<section id="primary" class="content-area col-sm-12 col-md-12 col-lg-8">
<div class="content-module">
<div class="content-item">
@marklchaves
marklchaves / add-config-gtag-user-id-functions.php
Last active June 8, 2022 16:45
WordPress User ID tracking for GA4 using gtag.js API
<?php /* Leave this line out when adding the below code to child theme functions.php */
/** This PHP hook supports GA4 tracking of the WordPress user ID. */
add_action( 'wp_head', function () {
// REMEMBER TO ADD YOUR MEASUREMENT ID BELOW
$gtag_config = "gtag('config', 'G-ABCDEFGHIJ');";
// If someone's logged in, let's track.
if ( is_user_logged_in() ) {
$gtag_config = "gtag('config', 'G-ABCDEFGHIJ', { 'user_id': '" . get_current_user_id() . "' });";
// Set the user_id custom dimension to allow recording and reporting in GA4. NOT NEEDED ANYMORE
@Trisky
Trisky / wp-sentry-integration.php
Created March 26, 2021 08:20
Wordpress Sentry performance integration mu-plugin
<?php
/**
* This is a modified mu-plugin for wp-sentry that enables Sentry Performance albeit it doesn't show the stacktrace
* Plugin Name: WordPress Sentry
* Plugin URI: https://github.com/stayallive/wp-sentry
* Description: A (unofficial) WordPress plugin to report PHP and JavaScript errors to Sentry.
* Version: must-use-proxy
* License: MIT
*/
@chavesm
chavesm / send-exit-intent-event-to-ga.js
Last active October 8, 2022 07:16
Send an exit-intent event to GA
/** Exit - intent event demo */
(function () {
if (!document.URL.includes("simple-form")) return;
const beforeUnloadListener = (event) => {
event.preventDefault();
// GA code goes here.
// Below is an example using gtag.js API.
@chavesm
chavesm / clean-up-url-search-query-parameters-in-ga-README.md
Last active November 17, 2021 14:20
ow to clean up URL search query parameters for Google Analytics reporting

How to clean up URL search query parameters for Google Analytics reporting

These instructions are for Universal Analytics properties.


Here's a screengrab of what we'd like to clean up.

Query parameters in site content report