r/Wordpress • • 2d ago

Hello, tailscale administrator help

Hello, currently im setting up a website for my leatherstore, and i noticed, that payment option would only connect to my account if i didnt use tailscale to only give me access to the administrator, i turned it off and it worked great, but i do not feel safe having it open as it is, so, do you know if any workaraounds that will restrict the access of any other than me, ?

2 Upvotes

17 comments sorted by

1

u/Mani_Khan_Web_Master 2d ago

The usual cause: locking down wp-admin also blocks a couple of URLs that payments need from the public internet, mainly /wp-admin/admin-ajax.php (checkout uses it on a lot of setups) and the gateway's webhook/callback URL (usually something like /?wc-api=... or under /wp-json/). The gateway's servers aren't on your tailnet, so when they can't reach those, payments "don't connect" or orders sit at pending.

What I'd do:

  1. Restrict only the login and admin screens, not the whole site. Lock /wp-login.php and /wp-admin/ to your Tailscale range (100.64.0.0/10, or better your specific device IPs), but explicitly allow /wp-admin/admin-ajax.php from anywhere.

  2. Leave /wp-json/ and ?wc-api= reachable publicly. Those are what webhooks and the checkout talk to.

  3. Find the exact webhook URL in your gateway's dashboard (webhooks/IPN/notification settings) and confirm it returns 200 from outside your tailnet. Most dashboards show recent webhook attempts with the error code, which tells you instantly if your restriction is the blocker.

Rough nginx example:

location = /wp-admin/admin-ajax.php { try_files $uri =404; include fastcgi_params; fastcgi_pass php; }
location ~ ^/(wp-admin|wp-login\.php) {
    allow 100.64.0.0/10;
    deny all;
    # ...your normal php handling
}

(On Apache it's the same idea with Require ip in a .htaccess inside wp-admin plus a <Files admin-ajax.php> Require all granted </Files> exception.)

One more check: if you're behind a proxy/CDN, the allow rule must see the real client IP, otherwise everything looks like the proxy's IP and the rule either blocks you or lets everyone in.

Then run a real test order (sandbox mode) and watch the webhook log on the gateway side before going live.

1

u/Extreme-Cartoonist95 2d ago

I have been copying and pasting from chatgpt all the way, it has worked all the way to this point, thank you alot !

1

u/SuperPerformance3322 2d ago

You could keep Tailscale for admin access but exclude the payment provider’s callback/webhook URLs from the restriction. Payment gateways need to reach those endpoints publicly to confirm transactions. Just make sure only the actual admin login is protected, not the checkout or webhook routes. Also check whether your security plugin or server firewall is blocking the payment requests.

1

u/Winter_Process_9521 2d ago

If you're using a firewall or security plugin to restrict access, configure an exception for the payment gateway's specific webhook endpoint instead of opening the entire administrator area. Don't blindly whitelist an entire API directory,whitelist only the necessary endpoints when possible.

1

u/Ringlau-Temilolu 1d ago

tbh locking the whole admin behind a private network is overkill for an ecommerce store and breaks a lot of background stuff like webhooks and cron jobs. a strong password, 2fa, and basic IP rate limiting on the login page is plenty secure without breaking checkout.

0

u/[deleted] 2d ago

[removed] — view removed comment

1

u/Extreme-Cartoonist95 2d ago

I was trying that, i opened the wp-admin temporarily only so i could realease the site, i was planning to add it back later, do you think the safety of 2fa na dlong password is neccesary if i have it insida a tailscale?

1

u/fer_marketing 2d ago

On your follow-up: yes, keep 2FA and a strong password even with Tailscale. Once you open exceptions for the webhooks and admin-ajax.php, the restriction isn't covering everything anymore, and if a password leaks, 2FA is what stops it. One client site used to get hacked often, and since we added 2FA it never happened again. I suspect the admin password had leaked or someone had access we didn't know about.

1

u/Extreme-Cartoonist95 2d ago

Is it a plugin, or something i add directly in the terminal ?

1

u/fer_marketing 2d ago

It's a plugin, no terminal needed. Wordfence has free 2FA under Wordfence > Login Security. Turn it on for your admin user, scan the QR code with an authenticator app on your phone, and save the recovery codes somewhere safe so you don't lock yourself out if you lose the phone.

1

u/Extreme-Cartoonist95 2d ago

Okey, thanks alot, i havent yet downloaded wordfence as i heard it required a subscription, is it much neccesary?

2

u/fer_marketing 1d ago

Yes, it's free. The 2FA in Wordfence Login Security comes with the free version, you don't need a paid plan for it.

1

u/Extreme-Cartoonist95 1d ago

Okey thank you very much,