Redirect a Custom Post Type’s Single and Archive Pages in WordPress
You may find that you need to hide or redirect a custom post types single or archive pages or even both in WordPress. This may be the case if you are outputting a custom loop of CPTs and don’t want duplicate content or discoverable pages which you don’t want published. In the above gist in…
Read MoreCache warming a website with Optimus Prime
Not all cache plugins or apps preload pages or provide a warm cache of all content, normally the first time a page is visited it is not cached but subsequent pages are. More plugins are providing pre-loading or warm cache solutions but some still don’t or web hosts don’t allow it – there are a…
Read MoreForce Password on SSH Connection
This is the command to force a SSH password between a client and server, you may have passwordless connection set up with SSH keys but want to check that a password is correct. ssh -o PreferredAuthentications=password -o PubkeyAuthentication=no [email protected] Swap out [email protected] with your connection details. Once logged in, if you want to change the…
Read MoreBlock xmlrpc.php and wp-login.php via NGINX
You can block xmlrpc.php and wp-login.php via NGINX with the configurations below, what’s good about this approach is that it prevents brute force attacks at the NGINX server level without any PHP/MySQL resources being used. xmlrpc.php for NGINX location = /xmlrpc.php { deny all; } To allow JetPacks IP addresses through adjust the config to…
Read MoreMove WooCommerce Product Long Description Into The Short Description Product Layout
How to move the woocommerce product long description text into the short description product layout with a couple of woocommerce actions and the long description tab removal. Remove The Description Tab This tab by default has the long product description. The above will remove all 3 tabs just comment out which if any tabs you…
Read MoreSet hostname and fqdn in Ubuntu 18.04 & 20.04 & 22.04
Hostname in Ubuntu 18.04 & 20.04 & 22.04 You can find and change the hostname with the commands hostname or hostnamectl in Ubuntu 18.04 & 20.04, if you run the command on its own it will tell you what the current name is, the example below is named racknerd-la hostnamectl root@racknerd-la:~# hostnamectl Static hostname: racknerd-la…
Read MoreBlock Modsec WAF from WordPress Website
You can block modsec WAF from your website via .htaccess with the following code… <IfModule mod_security.c> SecFilterEngine Off SecFilterScanPOST Off </IfModule> This may help when in development, remove when finished to get the protection back. If there is an actual rule you keep triggering you can make an exemption by IP address… # Whitelist 401…
Read MoreChange WordPress Domain URL with WP-CLI Tool
There are a few ways to change the main WordPress domain URL of a site – here is how to do it with the WP-CLI tool, which is probably the fastest and less problematic way of doing it. You’ll need to access your webhost via a shell session over SSH, once there switch directory to…
Read MoreChange ‘You may also like’ and ‘You may be interested in’ WooCommerce text
The text strings ‘You may also like’ and ‘You may be interested in’ in WooCommerce can be changed with the gettext filter… add_filter( ‘gettext’, ‘bt_translate_like’ ); add_filter( ‘gettext’, ‘bt_translate_like_cart’ ); /** * @snippet Trsnslate “You may also like…” Text – WooCommerce * @how-to Watch tutorial @ https://businessbloomer.com/?p=19055 * @sourcecode https://businessbloomer.com/?p=595 * @author Rodolfo Melogli…
Read MoreShow thumbnail images in WooCommerce order emails
Thumbnail images can be shown in WooCommerce order emails with the filter woocommerce_email_order_items_args add_filter( ‘woocommerce_email_order_items_args’, ‘bt_email_order_items_args’, 10, 1 ); /** * WooCommerce * Show thumbs in Order Email sent to customers */ function bt_email_order_items_args( $args ) { $args[‘show_image’] = true; $args[‘image_size’] = array( 150, 150 ); return $args; } If you want the images to…
Read More