My Google Searches

A running list of my searches and the results that helped me accomplish my tasks. |

Archive: Jun 2022

How to remove the reCAPTCHA badge in WordPress from pages that aren’t using reCAPTCHA?

by

What I was after

I recently upgraded to reCAPTCHA v3 with my site’s contact form and it annoyingly injected the reCAPTCHA badge on all of my site’s pages rather than just the ones that are actively using reCAPTCHA.

I was looking for a way to only show the badge on my Contact page.

The Result(s)

I came across this video by WordPress Tutorials – WPLearningLab, but their method no longer worked. I used it as a base for my own modified method.

The Important Bits

  1. Go to your WordPress theme’s CSS folder and add a new file with the following CSS (I named my file decaptcha.css):
     
    .grecaptcha-badge { visibility: hidden; }
  2. Edit your theme’s functions.php file and insert this string at the bottom of the file above the final ?> line:
     
    // Remove recaptcha tag from all pages but contact page
        add_action('wp_print_scripts', function () {
        //Add pages you want to allow to array
        if ( !is_page( array( 'contact' ) ) ){
        wp_enqueue_style( 'catcha-style', get_template_directory_uri() . '/css/decaptcha.css' );
        }
        });
  3. You may want to edit two things – 'contact' should be the slug of the page you want the reCAPTCHA badge to appear on and your CSS directory and the name of your “decaptcha” CSS file may be different.

Now the reCAPTCHA badge will only appear on the contact page. Hiding the tag via CSS is the Google-approved approach.

How to access Docker containers behind another Docker’s custom network remotely over VPN?

by

What I was after

So, you’re running Unraid and you have a few Docker containers that are using another Docker as their Network Type (say, to use that container’s encrypted traffic connection) – how do you access those Docker containers and their Web UI remotely over VPN? The default behaviour when using WireGuard to connect to your network remotely is that those containers wouldn’t be accessible.

[Here’s how to set up WireGuard on Unraid if you don’t have that bit in place yet.]

This issue seems pretty niche, but it impacts a lot of people and it’s hard to Google.

The Result(s)

Reddit user Adeon_eu to the rescue.

The Important Bits

  1. Go to WireGuard (for me, this was easiest to do on my phone’s WireGuard app) and get the Local tunnel network address (listed as Addresses under the Interface field on the WireGuard iOS app).
     
  2. Edit the parent docker whose network the other dockers are using and add the address to the LAN_NETWORK field, keeping the existing entry and adding the new IP range after a comma.
     
    • For example, maybe the LAN_NETWORK field was 192.168.1.0/24 and your WireGuard’s address is 10.253.0.0/24, the new entry for the LAN_NETWORK field should be 192.168.1.0/24,10.253.0.0/24.

Now you’ll be able to access those child Dockers when you’re away from home.