THAMER
Sovereign Bitcoin Wallet

WALLET AI BITCOIN

Your Bitcoin Wallet. Your Keys. Your Engine.

Self-hosted Bitcoin software built for developers, applications, and AI agents.

CREATE WALLET

How to Add a Bitcoin Donation Button to WordPress

permalink THAMER
#bitcoin#ghost#payments#wordpress

Use a Custom HTML block with a link to a merchant-controlled donation page. The PHP helper generates the markup for a theme or plugin. Replace the example URL in both the allowlist and caller. Do not embed wallet credentials in HTML. A static link does not track individual donations.

Source code

PHP · 6 lines
1<?php
2function btc_button(string $url): string {
3    if ($url !== 'https://example.org/donate') throw new InvalidArgumentException('Unapproved URL');
4    return '<a href="'.htmlspecialchars($url, ENT_QUOTES, 'UTF-8').'">Donate Bitcoin</a>';
5}
6if (PHP_SAPI === 'cli') { if (!str_contains(btc_button('https://example.org/donate'), 'Donate Bitcoin')) exit(1); }

Validation and deployment

Use a staging site and testnet first. Verify the destination, test duplicate payment notifications and keep fulfillment separate from browser requests. This example was checked locally, not inside a live CMS.

Related documentation

https://thamer.org/api

Questions & Answers

Explore all questions →

Latest from the Lab

THAMER illustrated developer portrait and signature

ABOUT THE DEVELOPER

Independent Software Developer specializing in Bitcoin Script, Golang, and AI Agents.

Software engineering · Independent research · Open-source projects