Downloadable SEO Keyword Rank Checker
Tracking where your pages rank for important keywords is one of the most basic — and most valuable — SEO tasks. While many services charge monthly fees for rank tracking, sometimes you just want a lightweight tool you can run locally.
This simple downloadable SEO keyword rank checker lets you check search result positions for a list of keywords and a target domain. It's useful for monitoring keyword progress, testing SEO changes, or tracking new content.
The script runs locally and can be expanded to export results or track rankings over time.
<?php
/*
Simple SEO Keyword Rank Checker
Upload this file to your server or run locally.
Enter a domain and keywords to check positions.
*/
function getRank($keyword, $domain){
$query = urlencode($keyword);
$url = "https://www.google.com/search?q=".$query;
$html = file_get_contents($url);
if(!$html){
return "Error fetching results";
}
preg_match_all('/<a href="\/url\?q=(.*?)&/i', $html, $matches);
$results = $matches[1];
$rank = 0;
foreach($results as $result){
$rank++;
$host = parse_url($result, PHP_URL_HOST);
if(strpos($host, $domain) !== false){
return $rank;
}
}
return "Not in top results";
}
if(isset($_POST["domain"])){
$domain = trim($_POST["domain"]);
$keywords = explode("\n", $_POST["keywords"]);
$results = [];
foreach($keywords as $k){
$keyword = trim($k);
if(!$keyword) continue;
$rank = getRank($keyword,$domain);
$results[] = [
"keyword"=>$keyword,
"rank"=>$rank
];
}
}
?>
<!DOCTYPE html>
<html>
<head>
<title>SEO Keyword Rank Checker</title>
<style>
body{
font-family:Arial;
background:#111;
color:#eee;
padding:30px;
}
textarea{
width:100%;
height:150px;
}
input{
width:100%;
padding:8px;
margin-bottom:10px;
}
button{
padding:10px 14px;
background:#6c5ce7;
color:#fff;
border:none;
cursor:pointer;
}
table{
margin-top:20px;
width:100%;
border-collapse:collapse;
}
td,th{
padding:8px;
border-bottom:1px solid #333;
}
</style>
</head>
<body>
<h1>SEO Keyword Rank Checker</h1>
<form method="post">
<label>Domain</label>
<input type="text" name="domain" placeholder="example.com">
<label>Keywords (one per line)</label>
<textarea name="keywords"></textarea>
<button type="submit">Check Rankings</button>
</form>
<?php if(!empty($results)){ ?>
<table>
<tr>
<th>Keyword</th>
<th>Rank</th>
</tr>
<?php foreach($results as $r){ ?>
<tr>
<td><?php echo htmlspecialchars($r["keyword"]); ?></td>
<td><?php echo $r["rank"]; ?></td>
</tr>
<?php } ?>
</table>
<?php } ?>
</body>
</html>
This type of lightweight rank checker is useful for developers and site owners who want to track keyword movement without relying on expensive subscription tools.
You can improve the script by adding CSV exports, storing historical rankings in a database, or visualizing ranking changes over time.
Comments (0)
No comments yet — be the first.