<?php
$url = "https://example.com"; // Replace with your site URL
$apiUrl = "https://web.archive.org/save/" . urlencode($url);
$response = file_get_contents($apiUrl);
if ($response !== false) {
echo "Site successfully pinged to archive.org!";
} else {
echo "Failed to notify archive.org.";
}
?>
I can also use the Wayback Machine’s bookmarklet to save any page by using this bookmarklet in the browser.
Best Practices
• Use the API sparingly to avoid overwhelming the service.
• Ensure your site adheres to robots.txt guidelines, as Archive.org respects these rules.
• If the page is private or restricted, the Wayback Machine may not archive it. Make sure the content is publicly accessible.
This way, you can keep your site’s updates reflected on the Wayback Machine!