Cloudflare is one of the greatest SEO tools out there today—hands down. If you’re only using it for speed enhancements, you’re seriously missing out on everything it can do.
While researching how some free movie sites serve pirated content, I stumbled across a Reddit list of around 50 sites. Most of them got obliterated by DMCA takedowns, but what stood out was the handful still standing. They were hosted using Cloudflare Workers and Pages, essentially running full sites off Cloudflare-owned subdomains.
Some of these URLs were still ranking in Google search results.
That means Google is fine indexing them, which opens up interesting SEO possibilities. Granted, generating a ton of CF subdomains or Workers linking to your main site might not pack the same SEO punch as traditional backlinks, but the fact that they’re indexed? That’s an untapped angle, especially compared to how overrun and devalued Web 2.0 blogs have become in the SEO game.
The Power of Cloudflare Workers
CF Workers are edge functions operating on Cloudflare’s global CDN, making them ridiculously fast. But it gets better:
- Cloudflare also offers a free database you can use to power an entire CMS.
- This means you can build and “host” applications directly on the edge—no server required.
I’ve used Cloudflare in the past for some clever hacks, like ditching MaxMind for geo-detection. With Cloudflare rules, you can serve geo-specific content (like JS files) that tweak the user interface based on location. It’s relly powerful on so many levels.
Cloudflare’s security capabilities are a whole other universe worth exploring. But for now, here’s a proof of concept script I wrote to pull a list of links from my blog feed. Feel free to use it—or tweak it. Remember: don’t happy, be worry.
addEventListener("fetch", event => {
event.respondWith(handleRequest(event.request))
})
async function handleRequest(request) {
const feedUrl = 'https://kadabra.co.za/feed/'
const randomImageNumber = Math.floor(Math.random() * 70) + 1
const backgroundImageUrl = `https://www.kadabra.co.za/wp-content/uploads/code-snippet.webp`
try {
const response = await fetch(feedUrl)
const xml = await response.text()
let items = xml.match(/<item>(.*?)<\/item>/gs) || []
let content = `
<html>
<head>
<title>Latest Posts from kadabra.co.za</title>
<meta name="robots" content="index, follow">
<style>
body{font-family:Arial,sans-serif;display:flex;align-items:center;justify-content:center;height:100vh;margin:0;background-image:url(${backgroundImageUrl});background-size:cover;background-position:center;transition:background-image 1.5s ease-in-out}.container{text-align:center;max-width:600px;background-color:#ffffffc9;padding:20px;border-radius:8px;box-shadow:0 4px 10px rgba(0,0,0,0.3)}.logo{max-width:150px;margin-bottom:20px}h1{font-size:24px;color:#333}p{font-size:16px;color:#666;margin:10px 0 20px}ul{list-style-type:none;padding:0}li{margin:10px 0}a{color:#000;text-decoration:none;font-size:18px}a:hover{text-decoration:underline}
</style>
</head>
<body>
<div class="container">
<a href="https://kadabra.co.za/">
<img src="https://www.kadabra.co.za/wp-content/uploads/google-logo.png" alt="News Logo" class="logo">
</a>
<h1>Latest News from kadabra.co.za</h1>
<p>Stay up to date with the latest news and updates from Kadabra.</p>
<ul>`
items.forEach((item, index) => {
if (index < 10) { // Limit to 10 posts
const titleMatch = item.match(/<title><!\[CDATA\[(.*?)\]\]><\/title>/) || item.match(/<title>(.*?)<\/title>/)
const linkMatch = item.match(/<link>(.*?)<\/link>/)
const title = titleMatch ? titleMatch[1] : 'No title available'
const link = linkMatch ? linkMatch[1] : '#'
content += `<li><a href="${link}" rel="dofollow">${title}</a></li>`
}
})
content += `
</ul>
</div>
</body>
</html>`
return new Response(content, {
headers: { 'content-type': 'text/html' }
})
} catch (error) {
return new Response('Error fetching feed', {
status: 500,
headers: { 'content-type': 'text/plain' }
})
}
}
Warning: All code found on this site is use at your own risk vibe. It worked for me when I wrote it, but if it breaks your stuff don’t come shout at me. Happy to help if I can, but there are no guarantees expressed and implied. This is merely an example for developers most of the code examples on this site are scripts that are used in Code Snippets functions.
Here’s a step-by-step guide to deploy this script as a Cloudflare Worker:
Step 1: Sign in to Cloudflare
- Go to the Cloudflare dashboard and log in to your account.
- If you don’t already have an account, sign up—it’s free for basic usage.
Step 2: Create a New Worker
- From the dashboard, click on “Workers” in the navigation panel.
- Select “Create a Service” and give your Worker a name (e.g.,
kadabra-feed-display
). - Choose “HTTP handler” as the type of Worker and proceed.
Step 3: Add Your Script
- Once the Worker is created, you’ll be taken to the script editor.
- Replace the default code with your script:
Here’s what it looks like live and here’s another one please feel free to switch out your own images and URLS if you use this code.
"The memory management on the PowerPC can be used to frighten small children."