Skip to content

Saved Search Defaults are ignored on 4 pages, which silently runs paid queries against the wrong market #8

Description

@michaelcopeland

Problem

Settings → Search Defaults says "Pre-filled values across all search forms." Four pages never read those values and fall back to hardcoded 'France' / 'French' instead:

page reads getSetting('default_location')?
keyword-overview ✅ yes
keyword-ideas ✅ yes
competitors ❌ hardcoded 'France'
keyword-data ❌ hardcoded 'France' / 'French'
ranked-keywords ❌ hardcoded 'France'
serp ❌ hardcoded 'France'

Why it's worth fixing beyond tidiness

Save United States / English in Settings, open Keyword Data, type your keywords, hit Search — and it runs against France unless you happen to notice and retype the location. Nothing in the UI indicates the saved value was discarded.

Since these endpoints draw down a prepaid DataForSEO balance, the cost of not noticing is a paid call returning data for a market you didn't ask about. I did exactly this before spotting it.

It's also inconsistent in a way that's hard to self-diagnose: Keyword Overview honours the setting and Keyword Data doesn't, so the same saved default appears to work on one page and not the next.

Reproduce

  1. Settings → set Default Location United States, Default Language English → Save
  2. Open /dashboard/keyword-overview → shows United States / English ✅
  3. Open /dashboard/keyword-data → shows France / French ❌

Fix

The pattern already exists in keyword-overview/page.tsx; the four pages just need it applied:

// before
const location = params.location ?? 'France';
const language = params.language ?? 'French';

// after
const location = params.location ?? getSetting('default_location') ?? 'France';
const language = params.language ?? getSetting('default_language') ?? 'French';

Keeping 'France' / 'French' as the final fallback means behaviour is unchanged for anyone who has never saved a default.

I have this working locally across all four pages — verified in the running app that all five now render United States with English as the selected option. Happy to open a PR if useful.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions