No. 77SEO7 min read1,962 words
How to build a directory website: search, SEO and data
How to build a directory website that ranks and stays useful: the MVP, Postgres search and filters, programmatic SEO without thin pages, moderation and cost.
- Written by
- Lazy Devs
- Published
- Updated
- Sources
- Cited inline

Key takeaways · 05
The short version
- 01A directory website MVP needs a structured listing model, fast indexable listing pages, browse and filter by category and location, typo-tolerant search, a moderated submission form and SEO foundations.
- 02Postgres with full-text search, trigram matching and indexed JSONB attributes handles most directories' search and filtering before a dedicated search engine is needed.
- 03Only publish category and location pages that have real listings and useful content. Thousands of near-empty template pages risk being treated as scaled, low-value content.
- 04Keep filter combinations out of the index: give each indexable page one canonical URL, and let other filter states stay crawlable only where they serve real searches.
- 05Directories rot. Plan de-duplication, stale-listing checks and a moderation queue before launch, because data quality is what users and search engines judge you on.
On this page · 12
To build a directory website, start with a clean, structured data model for listings, fast server-rendered listing pages with stable URLs, filters for category, location and a few key attributes, and search that tolerates typos. Add a moderated submission form and solid SEO foundations from day one. Leave accounts, reviews and paid placement until you have listings and traffic worth monetising.
A directory looks like the easiest project in the world: a list of things with filters on the side. Then you try to make search feel fast, get Google to index thousands of listing pages, and stop spammers filling your database with junk, and it becomes a real product. The good news is that the hard parts are well understood.
What a directory website is, and who it serves
A directory is a structured, searchable collection of entities (businesses, tools, professionals, properties, events) where each entity has its own page and people arrive mostly through search engines and filters. Think "accountants in Manchester", "project management tools for agencies" or "wedding venues near Austin".
The audience is usually two-sided. Seekers want to find the right listing quickly. Listing owners want to appear and look good. Your business model sits on top: featured listings, paid placement, lead fees or a subscription to claim and edit an entry. That two-sidedness makes a directory a cousin of a marketplace, and an even closer cousin of a job board, which shares the same dependence on structured data, search and SEO. Property portals are directories too, with listing feeds and map search on top; we cover those in web platforms for real estate.
The one job it must do well: get someone from a vague need to the right listing in a few clicks. Reviews, claiming and billing are supporting cast. If filtering and search are mediocre, no feature list saves you.
The directory MVP feature set
Build first
- A clean listing data model with categories, location and a handful of structured attributes.
- Listing pages that are fast, server-rendered and individually indexable, each with a stable, readable URL.
- Browse and filter by category, location and the two or three attributes people actually care about.
- Search that tolerates typos and partial matches.
- A submission form with an admin approval queue.
- SEO foundations. Sitemaps, structured data, canonical URLs, sensible titles and internal links between categories and locations.
Build later
- Owner accounts and "claim this listing".
- Reviews and ratings.
- Paid placement and billing.
- Saved searches, alerts, maps and personalisation.
The trap is treating reviews and accounts as MVP. They add moderation, authentication and spam surface for something that matters only once you have traffic and listings worth claiming.
Search and filtering that stay fast
Twenty listings work with anything. Twenty thousand with combined filters, a location radius and free-text search is a different animal. A naive like '%query%' query gets slow and returns poor results.
Postgres takes you a long way before you need a dedicated search engine:
- Full-text search with weighted fields, so a match in the name ranks above one in the description.
- Trigram matching with the
pg_trgmextension for typos and partial names. - JSONB attributes with a GIN index for per-category fields that change often.
- Location search with the
earthdistanceextension for simple radius queries, or PostGIS when you need real geospatial features like polygons and service areas.
A starting data model:
create extension if not exists pg_trgm;
create table listings (
id bigint generated always as identity primary key,
slug text not null unique,
name text not null,
description text not null default '',
category_id bigint not null references categories(id),
city text,
region text,
lat double precision,
lng double precision,
attributes jsonb not null default '{}',
status text not null default 'pending', -- pending | live | archived
verified_at timestamptz, -- last time someone confirmed the details
source text, -- where the data came from
created_at timestamptz not null default now(),
updated_at timestamptz not null default now(),
search tsvector generated always as (
setweight(to_tsvector('english', name), 'A') ||
setweight(to_tsvector('english', description), 'B')
) stored
);
create index listings_search_idx on listings using gin (search);
create index listings_name_trgm_idx on listings using gin (name gin_trgm_ops);
create index listings_attributes_idx on listings using gin (attributes);
create index listings_live_cat_idx on listings (category_id, city) where status = 'live';The generated search column stays in sync without a trigger. The trigram index makes fuzzy name lookups fast, and also helps with duplicate detection. The attributes column holds flexible per-category fields without a migration for every new filter. The verified_at and source columns are there because data quality will matter more than you expect.
When do you outgrow it? Usually when you need faceted counts across many attributes at once, heavy typo tolerance across long text, or very large datasets with complex ranking. Add a dedicated search engine then, fed from Postgres as the source of truth.
Programmatic SEO without thin content
A directory's growth engine is organic search across many long-tail pages: every listing, and every useful category and location combination. This is the area where directories most often stall.
Publish pages that deserve to exist
Auto-generating "Plumbers in [city]" for thousands of cities with the same template and no real listings is the classic mistake. Google's spam policies specifically call out scaled content abuse: many pages generated mainly to rank rather than to help people. A sensible rule is to only publish a category-location page when it has enough live listings to be useful, and to add something unique to it: local context, counts, comparisons, recent additions.
| Page type | Index it? | Notes |
|---|---|---|
| Individual listing | Yes, if live and reasonably complete | Unique details, structured data, links to its category and location |
| Category | Yes | Intro copy, top listings, links to locations |
| Category plus location | Only above a minimum number of listings | Otherwise return a 404 or noindex until it fills up |
| Filter combinations (price, rating, sort) | Usually no | Canonical to the parent page; Google's faceted navigation guidance explains the crawl cost |
| Internal search results | No | Keep out of the index |
Technical foundations
- Server-render every indexable page and keep it fast. Static generation with periodic revalidation suits listing and category pages well. Our Next.js caching explainer covers how to keep those pages fresh.
- One canonical URL per page. Google's guide to consolidating duplicate URLs covers the options.
- Split sitemaps. A sitemap file is limited to 50,000 URLs, per Google's sitemap documentation. In Next.js,
generateSitemapsproduces multiple sitemap files from one route. - Structured data. Business directories can mark up listings with LocalBusiness data generated from the same fields that render the page. Our guide to structured data that earns rich results covers the details and pitfalls.
- Remove or redirect closed listings rather than leaving dead pages indexed.
This is genuinely specialised work, and it is the core of our performance and SEO engineering practice.
Data quality: directories rot
Businesses close, phone numbers change and duplicates creep in. Your directory is only as trustworthy as its freshest entry.
- Record a source and verification date on every listing.
- De-duplicate on import by normalised name, address, phone and website domain, with fuzzy matching for near misses and a human review queue for uncertain matches.
- Re-verify on a schedule. Check websites still resolve, ask owners to confirm details yearly, and flag listings users report as wrong.
- Archive, do not delete. Keep history so you can restore a listing removed in error.
- Respect data licences. Check the terms of any dataset or site you import from. Some forbid reuse, and scraped data can create legal problems.
If you are importing messy data from several sources, the data pipeline can quietly become half the project. Budget for it.
Spam and abuse
The moment you have an open submission form, you get gambling links and SEO spam. Before launch, not after the flood:
- A moderation queue for every new listing and every edit to key fields.
- A bot check on the form, such as Cloudflare Turnstile or a similar CAPTCHA alternative.
- Rate limits per IP address and per account.
- Ownership verification by email domain or phone before someone can edit a listing.
- Outbound links from unverified listings marked as user-generated or
nofollow.
Monetising without wrecking trust
A directory's value is that people believe its results. Paid placement can erode that quickly if it is not handled carefully.
- Label paid placements clearly. "Featured" or "Sponsored" badges, visually distinct from organic results.
- Keep organic ranking honest. Sponsored slots sit in fixed positions, and they do not quietly reorder everything else.
- Sell enhancements, not existence. Charging owners for richer profiles, photos, lead forms or analytics works better than charging simply to appear, which empties the directory.
- Mark paid links appropriately. Links that are paid for should carry
rel="sponsored", which keeps you on the right side of search engine link policies. - Delay billing until the traffic is real. Owners pay for visibility, and visibility comes from the SEO work above.
If the plan is to charge seekers rather than owners, for gated listings or premium search, the model is closer to a paid community, and how to build a membership site covers the access and billing side.
The stack we would reach for
- Next.js for rendering: server-rendered and statically generated pages for SEO, with revalidation for freshness, in one codebase.
- Postgres for data and most of the search, so there is one system to operate.
- TypeScript end to end, so the listing shape is enforced from the database to the page.
- A CDN in front, because directory traffic is read-heavy and very cacheable.
- Background jobs for imports, de-duplication, re-verification checks and sitemap generation.
What drives the cost
We do not quote a directory we have not scoped. These are the factors that move the effort:
| Factor | Simpler | More involved |
|---|---|---|
| Data source | A clean dataset or manual curation | Many messy sources needing scraping, de-duplication and enrichment |
| Search | Keyword and a few filters | Faceted filters with counts, geospatial search, custom ranking |
| Page volume | Hundreds of pages | Tens of thousands of programmatic pages with quality rules |
| Owners | Submit via a form | Accounts, claiming, verification, dashboards |
| Revenue | None at launch | Paid placement, subscriptions, lead billing |
| Community | None | Reviews with moderation and response tools |
The single biggest swing is data. With a clean dataset you are mostly building the app. With messy data from many sources, you are building a data pipeline first.
Common mistakes to avoid
- Thin content at scale. Template pages without real listings get ignored or worse.
- Indexing every filter combination. It wastes crawl budget and creates duplicate pages.
- Slow filters. Index for the queries you actually run and load-test with realistic volumes, not fifty rows.
- No moderation plan. An open form with no queue becomes a spam farm within weeks.
- Stale data with no owner. Decide upfront who keeps listings fresh and how.
- Building accounts, reviews and billing too early. They are real systems. Earn them with traffic first.
Where to start
- Define what a listing is: its fields, categories and the two or three filters people use most.
- Source and clean an initial dataset, recording where each record came from.
- Build listing, category and location pages with search and filters.
- Add sitemaps, canonical URLs, structured data and quality rules for which pages get indexed.
- Launch, watch which searches and pages get traffic, and grow from there.
A directory is simple on the surface and demanding underneath, where search, SEO at volume and data quality live. This is squarely the kind of thing we build: content-heavy, search-driven sites where the engineering is quiet and the pages rank. If you are scoping a directory, get in touch and we will talk it through.
FAQ · 05 questions
Frequently asked questions
How do directory websites make money?
Common models are featured or sponsored placements, paid listings, subscriptions for owners to claim and enhance their entry, lead or referral fees, and advertising. Most new directories focus on traffic and listing quality first, then add paid placement once there is an audience worth paying to reach.
Should I build a directory on WordPress or custom?
A WordPress directory theme or plugin can work for a few hundred listings and simple filters. Build custom when you need fast multi-attribute filtering, location search, large numbers of programmatic pages, data imports and de-duplication, or a business model the plugin cannot support.
How do I get thousands of directory pages indexed by Google?
Make each page genuinely useful, server-rendered and fast, link pages together through categories and locations, and submit sitemaps split into files of up to 50,000 URLs. Do not publish empty or near-duplicate pages, and use canonical URLs so filter variations do not compete with each other.
Where do I get data for a directory website?
Typical sources are manual research, owner submissions, licensed datasets, public government registers and partner feeds. Check the licence and terms of any source before importing it, and record where each field came from so you can refresh or remove it later.
How do I stop spam submissions on a directory?
Put every new submission into a moderation queue, add a bot check such as a CAPTCHA alternative on the form, rate-limit submissions, and verify ownership by email or phone before a listing can be edited. Block outbound links from unverified listings or mark them as user-generated content.