Skip to content

Instantly share code, notes, and snippets.

@henshaw
henshaw / ungoogled-chromium.sh
Created October 13, 2025 01:54
Install Chrome without Google features
brew install --cask ungoogled-chromium
@henshaw
henshaw / functions.php
Last active September 28, 2025 18:06
Disable speculative loading in WordPress
//Disable speculative loading in WordPress
add_filter( 'wp_speculation_rules_configuration', '__return_null' );
@henshaw
henshaw / csr-geo-targeting.html
Created September 28, 2025 17:17
Example HTML tag for geo-targeting
<div class='geotargetlygeocontent1532057370878'>
<!-- Geo content will render here-->
</div>
@henshaw
henshaw / robots.txt
Last active September 25, 2025 05:12
Content Signals Policy for AI bots by Cloudflare for robots.txt
User-Agent: googlebot
Content-Signal: ai-train=yes, search=yes, ai-input=yes
Allow: /
User-Agent: bingbot
Content-Signal: ai-train=no, search=yes, ai-input=yes
Allow: /
User-Agent: OAI-Searchbot
Content-Signal: ai-train=no, search=yes, ai-input=no
@henshaw
henshaw / single.json
Last active August 10, 2025 16:53
ReportageNewsArticle Schema.org for WordPress single.php
{
"@context": "http://schema.org",
"@type": "ReportageNewsArticle",
"mainEntityOfPage": {
"@type": "WebPage",
"@id": "<?php the_permalink(); ?>",
"publisher":{
"@type":"NewsMediaOrganization",
"name":"Your Site Name",
"ethicsPolicy":"https://www.yourdomain.com/policies-and-standards/",
@henshaw
henshaw / functions.php
Last active August 3, 2025 20:52
Filters and actions to improve WordPress
<?php
// Disable RSS enclosures for media files
add_filter( 'rss_enclosure', '__return_empty_string' );
// Remove Gutenberg block styles, which I don't use
add_action( 'wp_enqueue_scripts', function() {
wp_dequeue_style( 'wp-block-library' );
} );
@henshaw
henshaw / functions.php
Created June 22, 2025 17:18
Remove Yoast SEO Schema structured data
function remove_yoast_json($data){
$data = array();
return $data;
}
add_filter('wpseo_json_ld_output', 'remove_yoast_json', 10, 1);
@henshaw
henshaw / homebrew-install.sh
Created May 4, 2025 16:11
Script for installing Homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
@henshaw
henshaw / breadcrumbe-schema.php
Created May 4, 2025 02:31
WordPress functions for dynamically inserting data into BreadcrumbList schema markup
// For category ListItem
"@id": "<?php echo $cat_link ?>"
"name": "<?php echo get_the_category( $id )[0]->name; ?>"
// For post ListItem
"@id": "<?php the_permalink(); ?>"
"name": "<?php the_title(); ?>"
@henshaw
henshaw / article-schema.php
Created May 4, 2025 02:30
WordPress functions for dynamically inserting data into Article schema markup
"@id": "<?php the_permalink(); ?>"
"headline": "<?php the_title(); ?>"
"description": "<?php echo get_the_excerpt(); ?>"
"datePublished": "<?php the_time('c'); ?>"
"dateModified": "<?php the_modified_time('c'); ?>"
// For author type
"name": "<?php the_author(); ?>"
"url":"<?php echo get_the_author_meta('user_url'); ?>"
// For image type
"url": "<?php if ( has_post_thumbnail() ) { the_post_thumbnail_url( 'full' ); } ?>"