Skip to content

Instantly share code, notes, and snippets.

View endurtech's full-sized avatar

Manny Rodrigues endurtech

View GitHub Profile
@endurtech
endurtech / endurtech-avada-cpt-filter.php
Created June 19, 2026 17:04
Organizing your website's URL structure is crucial for both user experience and SEO. A common challenge for WordPress users, especially those using robust themes like Avada, is separating different content types. By default, setting a global permalink structure like /blog/%postname%/ often forces all content—including FAQs and Portfolio items—in…
<?php
// Exclude Avada FAQs and Portfolio from the global permalink structure
// This ensures they appear at /faq/ and /portfolio/ instead of /blog/faq/ and /blog/portfolio/
// https://endurtech.com/how-to-separate-blog-faq-portfolio-urls-on-avada-wordpress-theme/
add_filter( 'register_post_type_args', 'endurtech_exclude_avada_cpts_from_blog_prefix', 99, 2 );
function endurtech_exclude_avada_cpts_from_blog_prefix( $args, $post_type )
{
// Define the post types to exclude
@endurtech
endurtech / SilentlyCleanTempFolders.ps1
Last active January 27, 2026 17:36
Automagically Clear the Windows Temporary Folders so that PaperPort doesn't hang. https://endurtech.com/fix-paperport-14-thumbnails-not-loading/
# PowerShell Script to Silently Clean Windows Temporary Folders
# https://endurtech.com/fix-paperport-14-thumbnails-not-loading/
# PaperPort relies heavily on the Windows temporary folder for caching thumbnails, processing scans, and managing large PDF operations.
# PaperPort generates many temporary files and if the Windows Temp folder reaches its file limit PaperPort will hang.
# To restore operation, clear the Temp folders using this script. Schedule this to run once per month with Task Scheduler.
# Clear Temp Files for User
Remove-Item -Path "$env:TEMP\*" -Recurse -Force -ErrorAction SilentlyContinue
@endurtech
endurtech / ChangeWindowsDesktopWallpaper.ps1
Last active December 5, 2025 18:54
Tired of manually setting your desktop background? Discover how to use a simple PowerShell script to automatically change your Windows 11 wallpaper using this script.
# PowerShell Script to Change Desktop Wallpaper on Windows 11
# https://endurtech.com/powershell-script-to-change-desktop-wallpaper-on-windows-11/
$imgPath = "$env:USERPROFILE\Pictures\Photo1.png"
$code = @"
using System;
using System.Runtime.InteropServices;
public class Wallpaper
{
<?php
// Hide Product Pricing for Logged-Out Users in WooCommerce
// https://endurtech.com/hide-product-pricing-for-logged-out-users-in-woocommerce/
if( ! is_user_logged_in() )
{
add_filter( 'woocommerce_get_price_html', 'woocommerce_hide_product_price' );
function woocommerce_hide_product_price( $price )
{
@endurtech
endurtech / disable-wordpress-plugin-update-notifications.php
Created August 5, 2025 21:20
While not recommended, there may be occasions when you would not want to be notified of available updates for a particular WordPress plugin. This code snippet is to be added to your theme's functions.php file to prevent those notifications from appearing within the Admin backend. https://endurtech.com/disable-wordpress-plugin-update-notices/
<?php
// Disable WordPress Plugin Update Notices
// Disables the WordPress Admin plugin update notifications for any specified plugin.
// https://endurtech.com/disable-wordpress-plugin-update-notices/
add_filter( 'site_transient_update_plugins', function ( $value )
{
if ( isset( $value->response['your-plugin-folder/your-plugin-file.php'] ) )
{
<?php
// Replace WordPress Admin Bar Welcome Message with Custom Text
// Replaces the default 'Howdy' welcome text at the top right next to the logged in username with text of your own choosing.
// https://endurtech.com/replace-wordpress-admin-bar-welcome-text-howdy/
add_action( 'wp_before_admin_bar_render', 'replace_howdy_text' );
function replace_howdy_text()
{
global $wp_admin_bar;
@endurtech
endurtech / Block Facebook Crawler facebookexternalhit 1.1.txt
Created June 23, 2024 18:46
The facebookexternalhit/1.1 is a user agent used by Facebook to crawl and index web pages for its various services, such as Facebook, Instagram, and WhatsApp. This crawler is responsible for retrieving content, images, and other metadata to improve Facebook's search functionality and provide users with relevant results. However, the facebookexte…
# BLOCK Facebook Crawler
# https://endurtech.com/block-facebook-crawler-facebookexternalhit/
RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} ^facebookexternalhit/1\.1 [NC]
RewriteRule ^ - [F,L]
# BLOCK Facebook Crawler END
@endurtech
endurtech / disable-subscriber-wordpress-admin-bar.php
Created March 28, 2024 18:03
Disables the WordPress Admin Bar and WordPress Admin Backend access for Subscribers. Insert into functions.php
<?php
// Disable Subscriber WordPress Admin Bar
// Disables the WordPress Admin Bar and WordPress Admin Backend access for Subscribers.
// https://endurtech.com/disable-subscriber-wordpress-admin-bar/
add_action( 'init', 'disable_admin_bar_for_subscribers' );
function disable_admin_bar_for_subscribers()
{
if ( current_user_can( 'subscriber' ) )
@endurtech
endurtech / rumble.bashr
Created May 11, 2023 23:09
A bash function I stumbled upon online. To be defined in .bashrc or just pasted into bash before exe. download. Once function is installed, run it via: |rumble <URL>|. Tested on Ubuntu 18.04lts and confirmed working.
rumble() {
youtube-dl --no-check-certificate -f mp4-480p/webm-480p/mp4-360p/mp4-720p/mp4-1080p $(curl -s "$1" | tr -d '\n'|awk -F "embedUrl" '{print $2}'|awk -F '"' '{print $3}');
}