Purpose
Find and enumerate sites already associated with the authenticated Wix account.
When to Use
Use when the caller asks to check, list, or inspect existing Wix sites in the account dashboard. This requires an authenticated Wix session.
Workflow
- Navigate directly to
https://manage.wix.com/account/sites(the equivalent account-sites routehttps://manage.wix.com/account/websitesmay be used if the first route redirects or is unavailable). - After the page loads, run this single-page extractor. It returns site-related links, visible labels, and Wix dashboard site IDs when present:
(() => {
const norm = s => (s || '').replace(/\\s+/g, ' ').trim();
const relevant = href => /manage\\.wix\\.com\\/(?:dashboard|account\\/(?:sites|websites))|wixsite\\.com|editor\\.wix\\.com/i.test(href || '');
const seen = new Set();
const sites = [];
for (const a of document.querySelectorAll('a[href]')) {
const href = a.href;
if (!relevant(href)) continue;
const label = norm(a.getAttribute('aria-label') || a.getAttribute('title') || a.textContent);
if (!label && !/dashboard\\/[0-9a-f-]{20,}/i.test(href)) continue;
const key = href + '|' + label;
if (seen.has(key)) continue;
seen.add(key);
const m = href.match(/\\/dashboard\\/([0-9a-f]{8}-[0-9a-f-]{27,})/i);
sites.push({label, href, siteId: m ? m[1] : null});
}
return {url: location.href, sites};
})()Site-Specific Gotchas
- Wix may redirect unauthenticated users to login; do not attempt to bypass authentication.
- The stable account-management routes are
/account/sitesand/account/websites; prefer the former and use the latter only as a fallback. - Site dashboard URLs commonly contain an opaque site ID after
/dashboard/; capture that ID from returned links rather than guessing it. - The account view is dynamically rendered, so extraction should run after DOM content is available and may need the page's normal load completion before evaluation.
- Do not navigate to editor URLs or public
wixsite.comURLs merely to determine which sites exist; those are secondary links and the account-sites page is the direct source.
Expected Output
An object containing the current URL and sites, an array of {label, href, siteId} records for the existing-site entries or related site-management links visible on the Wix account page.