You have a fair amount of domains registered through Namecheap and you’d like to export all the domain names in your account? Namecheap no longer have an export feature, but fear not.
Here’s a hack for you.
If you want to export a list of all your domains, you can resort to installing a browser extension that allows you to export tables or just a column in a table, which may or may not work.
There is, however, a much easier way to export all domains in your account.
Log in to your Namecheap account and go to the “Domain List” page
In the upper right, change the amount of domains shown from “25” to “View all”.
Open the DevTools console by right-clicking on the page > Inspect and open the Console tab.
Paste this code into the console and hit enter:
s = ''; jQuery(".domain-name p[title]").each(function(i,x) { s+=x['title']+"\n"}); copy(s)
And ta daaa… All your domain names are now copied to the clipboard. Paste it into a text file or for instance a spreadsheet.
Extract both your Namecheap domain names and their expiry date
If you want to extract both domain names and their expiration dates, paste the code below into the console and hit enter. It does the following:
- Extracts a list of all domain names (remember to change the domain list to “View all” first) and their expiry date, comma-separated
- Change the date format to
dd-mm-yyyy
- Displays the result in the console
- Copies the extracted data to your clipboard, ready to paste into, for instance, a text file or spreadsheet
function formatDate(date) {
let day = ('0' + date.getDate()).slice(-2);
let month = ('0' + (date.getMonth() + 1)).slice(-2);
let year = date.getFullYear();
return day + '-' + month + '-' + year;
}
s = '';
jQuery(".domain-name p[title]").each(function(i, x) {
var domainName = x['title'];
var expirationDateText = jQuery(this).closest('tr.item').find('td.expiring b').text();
var expirationDate = new Date(expirationDateText);
var formattedDate = formatDate(expirationDate);
s += domainName + ', ' + formattedDate + "\n";
});
console.log(s); // Display the result in the console
copy(s); // Copy the result to the clipboard
Paste the list of domains into Google Sheets
If you paste your domains and their expiry dates into a column in Google Spreadsheets, here is how you can easily split the data into two columns:
- Paste the data into a sheet
- Mark all the data in the column by clicking on the column letter above it (likely ‘A’)
- Click on the ‘Data’ menu and then the ‘Split text into columns’ menu item
Et voilĂ .
Here is a version that changes the date format to mm-dd-yyyy
instead of dd-mm-yyyy
:
function formatDate(date) {
let day = ('0' + date.getDate()).slice(-2);
let month = ('0' + (date.getMonth() + 1)).slice(-2);
let year = date.getFullYear();
return month + '-' + day + '-' + year;
}
s = '';
jQuery(".domain-name p[title]").each(function(i, x) {
var domainName = x['title'];
var expirationDateText = jQuery(this).closest('tr.item').find('td.expiring b').text();
var expirationDate = new Date(expirationDateText);
var formattedDate = formatDate(expirationDate);
s += domainName + '; ' + formattedDate + "\n";
});
console.log(s); // Display the result in the console
copy(s); // Copy the result to the clipboard