Skip to Assistance content

Quick Answer

Scan local HTML files for broken internal links, missing titles, missing meta descriptions, bad canonicals, and sitemap problems from a phone.

Use this guide only when your symptom or goal matches the indicators below. If a diagnostic command reveals a different problem, follow that evidence instead of forcing every remaining step.

Last reviewed: .

Use This Guide When

CheckBrokenLinksBasics

Before You Run Anything

  • Create a dated backup and verify that it contains the files required for recovery.
  • Preview the current state with listing, status, size, or dry-run commands before changing it.
  • Keep generated output, cache, secrets, and source files separated.

Diagnostic Or Setup Commands

This checker validates local targets and core SEO tags. It intentionally does not request external URLs.

pkg install -y python
python -m pip install beautifulsoup4
python - <<'PYCODE'
from pathlib import Path
from urllib.parse import unquote, urlsplit
from bs4 import BeautifulSoup

root = Path('.').resolve()
problems = []
for page in root.rglob('*.html'):
    soup = BeautifulSoup(page.read_text(encoding='utf-8', errors='replace'), 'html.parser')
    if not soup.title or not soup.title.get_text(strip=True):
        problems.append((page, 'missing <title>'))
    if not soup.find('meta', attrs={'name': 'description'}):
        problems.append((page, 'missing meta description'))
    if not soup.find('link', rel='canonical'):
        problems.append((page, 'missing canonical'))
    for tag, attr in [('a','href'),('img','src'),('script','src'),('link','href')]:
        for node in soup.find_all(tag):
            raw = (node.get(attr) or '').strip()
            if not raw or raw.startswith(('#','mailto:','tel:','data:','javascript:')):
                continue
            parsed = urlsplit(raw)
            if parsed.scheme or parsed.netloc:
                continue
            target = unquote(parsed.path)
            candidate = (root / target.lstrip('/')) if target.startswith('/') else (page.parent / target)
            if target.endswith('/'):
                candidate = candidate / 'index.html'
            if not candidate.resolve().exists():
                problems.append((page, f'broken {attr}: {raw}'))
for page, issue in problems:
    print(f'{page}: {issue}')
print(f'Problems: {len(problems)}')
PYCODE

What The Commands Tell You

  • `pkg install -y python` — Installs the listed Termux packages and dependencies.
  • `python -m pip install beautifulsoup4` — Installs or updates the named Python distribution, not pip itself.
  • `python - <<'PYCODE'` — Runs an inline Python diagnostic.

What Success Looks Like

  • The workflow can be repeated without overwriting the previous backup or losing current work.
  • The result can be verified with a simple list, diff, status, checksum, or test command.
  • A documented rollback restores the previous state when the new result is wrong.

Safe Next Steps

  1. Record the current state and create a recoverable backup.
  2. Apply one controlled change or maintenance action.
  3. Verify the result with a small command before continuing.
  4. Document what changed, where the backup is, and how to restore it.

Common Mistakes

  • Using a cleanup or update command without previewing what it will change.
  • Keeping the only backup inside the same folder that is being replaced or deleted.
  • Mixing secrets, cache, generated output, and source files in the same committed directory.

Still Stuck?

Copy the support report, fill in the missing values, and include the complete terminal output. Remove passwords, tokens, private keys, exact home paths, and personal information.

Turn This Fix Into A Repeatable Website Workflow

If you are building or publishing sites from your phone, the Build and Publish Website with AI guide connects HTML, CSS, JavaScript, Git, GitHub Pages, testing, rollback and mobile QA into one controlled process.

Preview the Website Guide