On the Cloudflare DNS tab change your A-records to a dummy IP.
Use IP: 1.2.3.4
Open the config file
wrangler.toml
and add the line:
[env.production]
Then add the route line:
route = "www.example.com/*"
You’d should prefix the domain with www according to this post.
Now you are ready to publish the static WordPress site with this command:
wrangler publish --env production
References about using a domain with Cloudflare Workers static WordPress