問題
リブランディング、古いアカウントの整理、または一からのやり直しなど、何千ものツイートを一つ一つ削除するのは現実的ではありません。Xには一括削除機能がなく、TweetDeleteのようなサービスは機能しますが、月々€6〜15を請求します。
無料の解決策
ブラウザのコンソールで直接実行できるJavaScriptスクリプトを作成しました。プロフィールを自動的にスクロールし、自分のツイートとリポストを識別して一つ一つ削除します。インストール不要、APIキー不要、外部サービス不要 — ブラウザだけで完結します。
@Sublime_Arts_の再ローンチ前に、古いXアカウントを自分たちでこのスクリプトを使って整理しました — 数百件の投稿を一切問題なく削除できました。
使い方 — 3ステップ
1XのプロフィールページにアクセスZnx.com/あなたのユーザー名
2DevToolsを開く:F12を押す → Consoleタブをクリック
3以下のスクリプトを貼り付けてEnterを押す。タブを開いたままにしてください。
機能
↩️すべてのリポストを取り消す
🗑️オリジナルツイートを削除
🔍メインフィード列のみ対象
⏭️広告・他人の投稿はスキップ
進捗はコンソールにリアルタイムで記録されます。8回の空スクロール後に自動停止。Xが追加投稿を読み込んだ場合は再実行してください。
スクリプト
cleanup_x_profile.jsF12 → Console
const sleep = ms => new Promise(r => setTimeout(r, ms));
async function cleanupXProfile() {
let repostsRemoved = 0, tweetsDeleted = 0, emptyScrolls = 0;
const getCol = () =>
document.querySelector('[data-testid="primaryColumn"]') ||
document.querySelector('main') || document;
const closeMenu = async () => {
document.dispatchEvent(new KeyboardEvent('keydown',
{ key: 'Escape', keyCode: 27, bubbles: true }));
await sleep(250);
const h = getCol().querySelector('h1, h2');
if (h) h.click(); await sleep(200);
};
console.log('🧹 X Profile Cleanup started...');
while (emptyScrolls < 8) {
let actions = 0; const col = getCol();
for (const btn of [...col.querySelectorAll('button')]
.filter(b => b.innerHTML.includes('M4.75 3.79l4.603'))) {
try {
btn.click(); await sleep(700);
const c = document.querySelector('[data-testid="unretweetConfirm"]');
if (c) { c.click(); repostsRemoved++; actions++;
console.log(`↩️ Repost removed #${repostsRemoved}`); await sleep(900);
} else await closeMenu();
} catch { await closeMenu(); }
}
for (const btn of [...col.querySelectorAll('button')]
.filter(b => b.innerHTML.includes('M3 12c0-1.1.9-2 2-2s2'))) {
await closeMenu(); await sleep(300);
try {
btn.click(); await sleep(800);
const del = [...document.querySelectorAll('[role="menuitem"]')]
.find(i => i.textContent.trim()
.match(/^(Delete|Elimina|Supprimer|Löschen|Eliminar|Удалить|削除|삭제)$/));
if (del) {
del.click(); await sleep(700);
const ok = document.querySelector('[data-testid="confirmationSheetConfirm"]');
if (ok) { ok.click(); tweetsDeleted++; actions++;
console.log(`🗑️ Tweet deleted #${tweetsDeleted}`); await sleep(1200);
} else await closeMenu();
} else await closeMenu();
} catch { await closeMenu(); }
}
if (actions === 0) { emptyScrolls++;
console.log(`Scrolling... (${emptyScrolls}/8)`);
} else emptyScrolls = 0;
window.scrollBy(0, 900); await sleep(2000);
}
console.log(`\n✅ Done! Reposts: ${repostsRemoved} | Tweets: ${tweetsDeleted}`);
}
cleanupXProfile();About
Patrick Chen — Sublimearts.ioの独立開発者。自分自身のXアカウントを再ローンチ前に整理しながら作成しました。