DEV Community

Jack Reacher
Jack Reacher

Posted on

Building a Location-Based Directory: What I Learned About Search, UX, and SEO

Location-based websites look simple from the outside like ArgentinaXP.

A user selects a city or neighborhood, sees a list of relevant profiles, opens one, and finds the information they need.

But building a directory that works well for both users and search engines involves considerably more than displaying a list of pages.

While working on ARGXP, a location-focused directory for Argentina, I started looking at the problem from a technical perspective: How should a directory organize locations? How should URLs be structured? How can we avoid duplicate content? And how can search and SEO work together without sacrificing user experience?

Here are some of the lessons I've learned.

  1. Location Should Be Part of the Information Architecture

One of the first decisions is how locations should be represented.

A basic structure might look like:

Argentina
├── Buenos Aires
│ ├── Palermo
│ ├── Recoleta
│ ├── Belgrano
│ ├── Núñez
│ └── Puerto Madero
└── Córdoba
└── Nueva Córdoba

This hierarchy isn't only useful for humans.

It also gives search engines a clearer understanding of how individual pages relate to one another.

Instead of treating every location as an isolated page, the site becomes a connected geographic structure.

For example:

/argentina
/buenos-aires
/buenos-aires/palermo
/buenos-aires/recoleta
/buenos-aires/belgrano

The exact URL structure depends on the project, but consistency is more important than complexity.

  1. Don't Generate Thousands of Thin Pages

This is one of the biggest challenges with directory websites.

Once you have:

Locations
Categories
Filters
Sorting
Languages
Services
Price ranges

it's very easy to accidentally generate thousands of URLs.

For example:

/location/palermo
/location/palermo?sort=price
/location/palermo?sort=rating
/location/palermo?category=x
/location/palermo?category=x&sort=price

Technically, these may all be valid pages.

But that doesn't mean all of them deserve to be indexed.

A better approach is to distinguish between:

Useful landing pages

and

temporary search/filter states.

Search and filter parameters can still be extremely useful for users without becoming separate SEO pages.

  1. Use Canonical URLs Carefully

When multiple URLs can display substantially similar content, canonicalization becomes important.

For example:

rel="canonical"
href="https://example.com/buenos-aires/palermo"
/>

The canonical URL should represent the primary version of the page.

But canonical tags shouldn't be treated as a solution for every duplicate-page problem.

It's better to design the URL architecture correctly from the beginning.

  1. Directory Search Is a UX Problem, Not Just a Database Query

A directory might contain hundreds or thousands of records.

A simple database query could return:

SELECT *
FROM profiles
WHERE location = 'Palermo';

But the user doesn't necessarily want "all profiles."

They might want:

Location: Palermo
Category: Wellness
Language: Spanish
Availability: Today
Sort: Recently Updated

That means your search system needs to understand multiple dimensions.

A simplified API request could look like:

GET /api/profiles?
location=palermo
&category=wellness
&language=spanish
&sort=recent

The backend can then translate those parameters into an optimized database query.

The important part is keeping the API predictable.

  1. Index the Fields You Search Frequently

If your directory grows, database performance becomes important.

Suppose users frequently search by location and category.

A database index such as:

CREATE INDEX idx_profiles_location_category
ON profiles(location_id, category_id);

can make those queries much more efficient.

The exact indexes should be based on real query patterns rather than assumptions.

Before adding indexes everywhere, measure.

Tools such as EXPLAIN can help identify expensive queries.

  1. Profile Pages Need Stable URLs

Individual profiles should ideally have permanent, readable URLs.

For example:

/profiles/maria-example

is generally easier to understand than:

/profile?id=847293

If a profile changes location, the URL doesn't necessarily need to change.

This is an important distinction:

The profile identity and the profile's current location are different pieces of data.

That makes the system more resilient as the directory changes over time.

  1. Structured Data Can Help Search Engines Understand Pages

Directory websites contain structured information naturally.

For example:

Name
Location
Organization
Website
Rating
Category
Address
Updated date

Where appropriate and supported by the content, Schema.org structured data can communicate some of this information to search engines.

For example:

{
"@context": "https://schema.org",
"@type": "LocalBusiness",
"name": "Example Business",
"address": {
"@type": "PostalAddress",
"addressLocality": "Buenos Aires",
"addressCountry": "AR"
}
}

The important rule is simple:

Only mark up information that is actually present and accurate on the page.

Structured data shouldn't be used to manufacture information that users can't see.

  1. Freshness Matters More Than Most People Think

Directories are dynamic.

Profiles change.

Locations change.

Businesses close.

New listings appear.

Information becomes outdated.

That means a directory needs a strategy for freshness.

Useful fields can include:

created_at
updated_at
last_verified_at
status

This makes it possible to identify stale records.

For example:

Active
Recently updated
Needs verification
Inactive
Removed

The frontend can then communicate appropriate status information to users.

  1. Build Internal Linking Into the Product

Internal linking shouldn't be an afterthought.

A location page can link to:

Nearby locations
Popular profiles
Related categories
Other neighborhoods

A profile page can link back to:

Current location
Related profiles
Nearby locations

This creates a network:

Location

Category

Profile

Related Profile

Nearby Location

That structure is useful for navigation and can also help search engines discover important pages.

  1. Mobile UX Should Come First

Location directories are often used from mobile devices.

That changes the design priorities.

A desktop interface might have:

[Location] [Category] [Price] [Sort] [Search]

On mobile, the same interface can become overwhelming.

A better mobile experience might use:

Search

Location

Filters

Results

Large tap targets, fast loading, readable cards, and simple navigation usually matter more than adding another visual element.

  1. SEO and UX Should Have the Same Goal

One mistake I see frequently is designing a page for Google first and users second.

That often leads to:

repetitive paragraphs
excessive keyword usage
unnecessary headings
generic location descriptions
pages created only because a keyword exists

A better approach is to ask:

Would this page still be useful if Google didn't exist?

If the answer is yes, you're probably building something valuable.

For ARGXP, that means location pages should primarily help visitors discover relevant information about Argentina and its different areas, while SEO becomes a natural result of having useful, well-structured pages.

  1. A Simple Architecture Can Go a Long Way

A directory doesn't necessarily need a complicated architecture.

A simplified application could look like:

Frontend

Search/API Layer

Application Logic

Database

Search Index

The search index can become useful as the dataset grows.

For smaller projects, database queries may be enough.

For larger datasets, technologies such as Elasticsearch, OpenSearch, or Typesense can provide more advanced search capabilities.

The correct solution depends on:

Dataset size
Search complexity
Traffic
Infrastructure
Budget
Latency requirements

Don't introduce search infrastructure before you actually need it.

Final Thoughts

Building a location-based directory taught me that the hardest part isn't creating a page for every location.

The hard part is creating a system where locations, profiles, search, SEO, and user experience all work together.

A successful directory should make it easy for a user to answer three questions:

Where am I looking?

What options are available?

Which option is relevant to me?

Once those questions are handled well, the SEO architecture becomes much more natural.

That's the approach I'm continuing to explore with ARGXP: building a cleaner, location-focused discovery experience for Argentina while treating SEO as part of the product architecture rather than something added after the website is built.

Top comments (0)