Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

Guia Search Engine

Context: B2B commercial professional (not a programmer) using AI as a copilot to build business tools. This is the search engine for Guia Brasileiros na Espanha, a B2B directory with 97,000+ active members.

The problem

A directory with hundreds of listings needs a fast way for visitors to find who they're looking for — by city and service category — without relying on WordPress' generic search, which doesn't support that level of filtering or prioritize premium-tier listings.

Who it's for

Directory visitors (Brazilians in Spain looking for a specific professional/service) and, indirectly, premium listers, who need guaranteed visibility in search results.

The solution

A results page that filters listings by city and category (via query string, coming from a search form) and reorders results so premium-tier listings always appear first — without a separate query or "sponsored" logic bolted on. The reordering happens in memory: IDs returned by the main query are split into two groups (premium / regular) and re-fetched in a second query with post__in, preserving that order.

Architecture

Search form (city + category)
        ↓
Input sanitization (sanitize_text_field + anti-injection regex on category)
        ↓
WP_Query on the "anunciante" custom post type (up to 50 results, meta_query filter)
        ↓
In-memory split: premium[] vs regular[]
        ↓
Second WP_Query respecting the premium → regular order
        ↓
Responsive grid (pure CSS, no JS) with photo, category, city, direct WhatsApp button

Stack

  • WordPress (Astra child theme — astra-child)
  • Native PHP (no framework)
  • WP_Query / Custom Post Types / Custom Fields (ACF-like: cidade, categoria, plano, whatsapp, foto_do_perfil, descricao_curta)
  • Inline CSS (no build step dependency)

Result

Search engine in production, used by the directory's 97,000+ members. The Guia's real customer acquisition cost: €8 vs a €15 target — the search engine is one of the pieces that sustains retention once someone joins the directory.

How to use

  1. Requires WordPress with Astra + a configured child theme
  2. Create an anunciante custom post type with the fields: cidade, categoria, plano (premium/regular), whatsapp, foto_do_perfil (attachment ID), descricao_curta
  3. Place page-buscar.php in wp-content/themes/[your-child-theme]/
  4. Create a WP page with the slug buscar (or rename the template per WordPress' template naming convention)
  5. Point the search form to that page, passing cidade and categoria as GET parameters

Roadmap

  • Migrate category/city filtering to semantic search (intent matching, not just exact string)
  • Pagination (currently capped at 50 results, no pagination)
  • Query caching to reduce load during traffic spikes

Built with Claude as a development copilot.

About

Search engine for the Guia Brasileiros na Espanha directory (97k+ members). Filters by city/category and prioritizes premium listings without an extra query. WordPress + native PHP.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages