You can build a WordPress directory website without coding every listing page from scratch. Use a Claude Sonnet coding assistant to draft an original theme from design screenshots, then add custom fields and import business listings from a source you are allowed to reuse. This guide uses a US law firm directory to show the workflow, from theme setup to data checks and launch. It also covers where to get listing data, how to build the same directory more cheaply with Claude Haiku 4.5, when to start from an expired domain, and how to monetize the result.
Quick Answer
To build a WordPress directory website with Claude Sonnet, choose a design reference, define your listing fields and locations, generate and test a custom theme, then import licensed or permitted business data with an XLSX-compatible plugin. Check every listing and page before launch. AI speeds up drafting but does not replace testing or data verification.
The original project used Claude Sonnet 4, GFast Scraper, Advanced Custom Fields (ACF), and a spreadsheet importer. You can follow the same steps with a currently supported coding model and a data source that permits directory publication.
Key Takeaways
- Start with a directory-style inspiration site that matches the structure, layout, and browsing experience you want.
- Collect business data only when the source and applicable rules permit reuse, then clean an XLSX file before importing.
- Give your Claude coding assistant exact theme, post type, taxonomy, field, and US-location requirements.
- Keep listing post types in a plugin, use ACF for details, and confirm your importer supports XLSX and ACF mapping.
- Test a small import, then review location pages, listing accuracy, mobile layouts, and search before launch.
At a Glance
| Best For | WordPress users who want to build a niche directory faster with AI-generated theme files and imported listing data. |
|---|---|
| Difficulty | Intermediate. You should be comfortable with WordPress, themes, plugins, local testing, and basic troubleshooting. |
| Tools Needed | Visual Studio Code, Local WP, an available Claude Sonnet coding model, permission-cleared business data, ACF, and an XLSX/ACF-compatible importer. |
| Main Goal | Create a custom WordPress directory with listing pages, taxonomy archives, images, business details, and a design inspired by your screenshot reference. |

How to Plan Your WordPress Directory and Prepare Data
Choose a directory site with the search, category pages, and listing cards you want to learn from. In the original project, I selected a law firm directory as a design reference, not as a source of branding or copy.
Study how the homepage, search box, location filters, listing cards, and detail pages work on desktop and mobile. Record the useful patterns, then create your own colors, typography, icons, images, and page copy.
Warning: Do not copy another site’s logo, text, photos, or protected artwork. Do not assume that visible business profiles or third-party images are free to republish. Use screenshots for general layout ideas and confirm your rights to each data source.
In the original workflow, I provided a screenshot to Sonnet 4 and used a tool called GFast Scraper to assemble a sample dataset. The scraper’s current availability, permissions, and features have not been independently confirmed. A scraper is not proof that the collected information can legally be republished.
- Define a US law firm search area and the business details you need.
- In this example, aim for a limited pilot dataset of up to 100 records; available results depend on the tool and source.
- Collect only permitted fields, such as business name, contact details, location, practice area, and business hours. Use photos only with permission.
Save the permitted dataset as an XLSX file with one business per row. Keep a source URL, retrieval date, and stable source ID for each record so you can correct or update it later.
Remove duplicates and blank rows. Standardize names, city and state labels, phone numbers, and office websites. Check contact details against official firm sites where possible. Treat missing hours as unknown rather than inventing them, and leave image fields blank unless you have usage rights.

Pick the Niche With Keyword Research First
A directory only earns if people search for what it lists. Check that before writing a single prompt.
Find Low-Difficulty Keywords for the Niche
Use a tool like Semrush to identify search phrases that include the word “online.” Filter your results to show keywords with low difficulty scores, ideally between 0% and 14%. Your goal is to find specific converters that users want but that major sites currently ignore.

Niche converters often have search volumes over 100 with very low competition. One effective example is a “MAC address to IP address converter online” because this specific search attracts users looking for technical solutions.

Note: Low difficulty does not guarantee traffic or profit. Check the search results manually to make sure the keyword has clear intent, weak competing pages, and a tool format you can build well.
What makes a good tool keyword?
A strong tool keyword usually includes a clear action. Words like converter, calculator, checker, generator, formatter, estimator, and lookup show that the user wants a working tool, not just an article. The more specific the phrase is, the easier it may be to match the intent.
- Good: “MAC address to IP address converter online”
- Good: “PNG to WebP converter WordPress tool”
- Too broad: “online converter”
- Too unclear: “networking help”
How to Write a Claude Sonnet Prompt for a Directory Theme
Claude Sonnet works best with a clear specification of the site structure and the code you want. The original Sonnet 4 API model was retired on June 15, 2026, so select a supported model in your editor before starting. See Anthropic’s model retirement documentation.
Tell the assistant to create a classic WordPress theme with PHP templates and to keep listing data separate from the theme. WordPress recommends registering custom post types in a plugin, so changing themes does not remove the post type from the admin. See WordPress custom post type guidance.
Your prompt should include these specific variables:
- Folder Name: Use a descriptive, hyphenated name like “law-firm-theme-sonnet-four”.
- Site Title: Define the name of your directory.
- Custom Post Type: Use
law_firmas the internal post type key in a small companion plugin; uselaw-firmsfor the public URL slug if desired. - Custom Taxonomy: Register a hierarchical
locationtaxonomy, with US states as parent terms and cities as child terms, or document another clear state/city approach. - Directory Category: Use a
practice_areataxonomy if you need filters such as family law or estate planning. Do not assume a category label alone improves rankings. - Country: Specify the United States and choose consistent state, city, and address formats.
End the prompt by asking for an original, responsive visual system informed by the screenshots, not a pixel-for-pixel clone. Supply your own brand colors and ask the model to flag any files or design assets it cannot generate safely.
Example Claude Sonnet Prompt for a Law Firm Directory
Use this short specification as a starting point. Replace the project name and add your own branding details before running it.
Build an original, responsive classic WordPress theme for a US law firm directory.
Theme folder: law-firm-theme-sonnet-four
Post type: law_firm, registered in a companion plugin
Public listing slug: law-firms
Taxonomies: location (state > city), practice_area
ACF fields: address, phone, website, hours, source_url, verified_date
Pages: homepage, archive, single listing, location, search, 404
Design: use the attached screenshot for structure only, not logos or artwork
Code: safe escaping, accessible forms, responsive CSS, no hard-coded listings
Deliver: file tree, code, plugin setup, installation steps, test checklist
Flag assumptions and do not claim the code has been tested. Pro Tip: Request front-page.php, archive-law_firm.php, single-law_firm.php, taxonomy-location.php, search.php, header.php, footer.php, and reusable listing cards, with safe fallbacks when a field is empty.
Request responsive CSS, keyboard-friendly navigation, escaped output, validated URLs, secure form handling, and correct WordPress template conventions. Ask for an explicit file list, setup steps, and a list of items that still need manual testing.

Generate and Review the WordPress Directory Theme
Set up a test WordPress site in Local WP and open the site’s theme directory in Visual Studio Code. A local site reduces the risk of breaking your live website. Some AI features still require an internet connection.
Create a folder such as law-firm-theme-sonnet-four under wp-content/themes/. Paste your instructions into the supported coding assistant and attach the reference screenshots. Review the files it drafts, then request corrections in small steps rather than assuming the first output is complete. Register the law_firm post type and taxonomies in a companion plugin, not only in the theme.
For a classic theme, check that style.css contains a valid theme header and that index.php exists. Review functions.php and each archive, single-listing, and taxonomy template. Confirm that field names match ACF exactly. Run PHP syntax checks and inspect the code for unsafe direct output, unsanitized input, and unexpected external requests.
Note: AI-generated PHP and JavaScript may contain errors or insecure patterns. Test on a local or staging site first, keep backups, and review any code that processes forms, uploads, search queries, or user data.

Installing and Activating Your Generated Theme
If the generated folder is already inside your local site’s wp-content/themes/ directory, open Appearance > Themes and activate it. To install a ZIP on another WordPress site, use Appearance > Themes > Add New > Upload Theme, then activate it after checking the files.
Install ACF and create a field group assigned to the law_firm post type. Add fields such as address, phone, website, hours, and a source or verification date. If you use ACF Local JSON, create a writable acf-json folder inside the active theme. ACF can save field groups there; supplied local JSON files may show a Sync available option when their database versions are missing or older. See the ACF Local JSON guide.
After activation, save permalinks under Settings > Permalinks if new archive URLs return 404 errors. Check the homepage, the listings archive, a state or city page, and a single listing. Confirm that the post type and taxonomy are registered and that ACF values appear only in their intended locations.

Where the Listing Data Comes From: Scraping and Cleaning
The XLSX import below assumes you already have clean rows. This is how to get them.
Gather Listings With a Scraper
A directory website depends on relevant, useful, and accurate listings. To populate your site, gather niche-specific business data. This example focuses on Notary Public services in the United States.
Collect this data using a business listing scraper like GFASTSCRAPER. This cloud-based tool extracts business information from Google Maps and other public sources, depending on the settings and sources available inside the tool.
After signing in, navigate to the Scrape Business Listings section. Choose your category, set the country to the United States, and limit the number of results to 1,000 for your initial build. For a broad national example, do not narrow the search by state or city, because a wider query captures more locations.

The tool may fetch business names, addresses, phone numbers, websites, images, categories, and location details. Once the process finishes, download the data as a CSV file.

Warning: Always review the scraper platform’s terms, the source site’s terms, and privacy rules before collecting or republishing business data. Avoid publishing private, sensitive, misleading, or unverified information.
Clean and Format the Data Before Import
Before importing scraped data into WordPress, clean and format it carefully. Open your CSV file in Microsoft Excel or Google Sheets and inspect every column that will become part of your directory.
Save the file as an .xlsx document to improve compatibility with import plugins. Standardize regional data by ensuring state names follow a consistent format.
Sort your “Region” column alphabetically and replace all abbreviations with full state names. For example, use “California” instead of “CA” and “New York” instead of “NY” if your taxonomy is designed to use full state names.
This step is time-consuming, but it is essential for a professional user experience. Clean data helps your filters, taxonomy pages, internal search, and listing templates work correctly.

What to Clean Before Importing
- Business names: Remove duplicates, extra spaces, strange characters, and incomplete names.
- Addresses: Check that street, city, state, and ZIP code fields are consistent.
- Phone numbers: Standardize formatting so numbers look professional across every listing.
- Website URLs: Remove broken or incomplete URLs and use a consistent format.
- Images: Make sure image URLs are valid and suitable for public display.
- Categories: Keep category names short, clear, and consistent.
- Taxonomies: Use one naming style for states, regions, cities, or service areas.
Pro Tip: Create a small test file with 10 to 20 listings first. Import that file before uploading hundreds or thousands of rows so you can catch mapping errors early.
Import XLSX Business Listings into WordPress
Choose an importer that supports Excel files, your custom post type, hierarchical taxonomies, featured images, and ACF fields. These options are not universal across plugins or license tiers. For example, WP All Import documents Excel and ACF mapping through its integration.
Example Spreadsheet-to-WordPress Field Map
| XLSX column | WordPress destination | Check |
|---|---|---|
| business_name | Post title | Use the firm’s current public name |
| state / city | location terms | Correct parent state for each city |
| phone / website | ACF contact fields | Validate phone and website format |
| source_id | Importer unique identifier | Stable across future imports |
| image_url | Featured image | Only import authorized images |
- Upload your prepared XLSX spreadsheet.
- Select the registered
law_firmpost type. - Map state and city columns to your chosen
locationtaxonomy or separate location structure. - If using one hierarchical
locationtaxonomy, create cities as child terms under their correct state parent terms. - Map ACF fields, featured images you have permission to use, and a unique source ID for later updates.
Preview the field mappings, including how the plugin treats empty values. Set an appropriate unique record identifier so a later import updates an existing firm instead of creating a second copy. Make a database backup before running the import.
Import 5 to 10 rows first. Check names, addresses, phone numbers, hours, images, cities, and state pages on both the edit screen and the public site. Correct mapping errors before importing the full spreadsheet; verify record counts again when it finishes.
Pro Tip: Save the untouched source spreadsheet, a cleaned working copy, and an import log. A consistent unique ID makes future corrections and repeat imports safer.

Reviewing Design and Functionality
Review the site after your small test import and again after the full import. Make sure the header, footer, and navigation support your own branding and work with real listing data.
Open sample listings and compare their contact details with your approved sources. Confirm that each state page shows the right city links and that filters return matching firms. Do not display unverified hours as confirmed facts.
Test search with a firm name, a city, and a practice area. Check the empty-results state, keyboard navigation, readable contrast, touch targets, and layout on mobile screens. Search and filters must work, not simply look interactive.
Visitors should be able to find the right firm, see where the information came from, and contact that firm without confusion.

Validating Data Structure
Open several state and city archives, including cities that share a name across states. Each archive should show only firms assigned to the correct terms.
Each single listing should show the firm name, address, contact methods, practice areas if verified, and a link to its official website. Add nearby listings only when the location match is meaningful.
Use one style for state labels and one location path for each city. For example, do not create separate California terms called “CA” and “California”. Under a parent/child system, “Springfield, Illinois” and “Springfield, Missouri” must be distinct child terms.
Check duplicate business records by source ID and address rather than title alone. Verify image permissions, make missing data visible as missing, and provide a way for firms to request corrections. If many records share the same error, repair the source data or field mapping before importing more.

Cheaper Build: The Same Directory With Claude Haiku 4.5
Sonnet gives the best first draft, but Haiku 4.5 can do most of this job for a fraction of the token cost. Here is what changes.
Why Haiku 4.5 Is Enough for Most of It
Haiku 4.5 offers a more affordable alternative to larger AI coding models while still understanding structured developer prompts well enough for practical WordPress work. That makes it useful when you need high output volume, quick tests, and low operating cost.
For this kind of build, the main advantage is not just price. The model can follow a long prompt, understand naming conventions, create related files, and keep the structure consistent across templates, fields, and taxonomies.

What It Cost and What Came Out
The directory build cost roughly $0.33 using Haiku 4.5. This makes it a practical option for bulk creation when you need to minimize AI usage costs. The final result included the core WordPress structure, directory listing support, taxonomy setup, and sample content output.
Even with a strong result, you should expect small manual fixes. In my test, the types of areas worth checking included JavaScript behavior for maps or hero sections, imported data formatting, mobile spacing, and field output consistency.
This workflow is most valuable when you treat Haiku 4.5 as a low-cost builder for prototypes and structured WordPress assets. For a production site, the generated code still needs developer review, security checks, and final QA.
Where Haiku Falls Short
Haiku 4.5 can generate useful WordPress code, but it is not perfect. The quality depends heavily on prompt clarity, editor support, file access, plugin setup, and the complexity of the build.
- Plugin assumptions can be wrong: The model may assume a plugin structure that differs from your actual setup.
- Imports need testing: XLSX column mapping can fail if field names or taxonomy relationships are inconsistent.
- Design polish varies: You may need to adjust spacing, typography, cards, and responsive layouts.
- Security review is required: Generated PHP should be checked for escaping, sanitization, and safe output.
- SEO still needs human judgment: AI can build templates, but content strategy and quality control remain your responsibility.
Starting From an Expired Domain Instead of a Fresh One
A clean expired domain with real backlinks can shorten the months a new directory spends waiting for trust.
Why an Expired Domain Helps a Directory
Expired domains can provide a head start because they may already have backlinks, history, and topical relevance. That does not mean every expired domain is valuable. A strong domain should match your niche, have natural links, show a clean archive history, and avoid spam patterns such as hacked pages, casino redirects, adult content, or irrelevant foreign-language link blasts.
Browse directory-related expired domains to uncover niche ideas and site structures that already worked in the past. For example, a former city guide, local business hub, professional association directory, or niche resource site may provide a stronger foundation than a brand-new domain with no history.
Warning: Do not buy an expired domain only because it has a high domain rating. Check its past content, anchor text, referring domains, indexed pages, and spam history before using it for a directory project.

Auction vs Register-Now Purchases
- Instant registration: Some domains remain available at standard registrars for a basic fee.
- Auctions: High-value domains often appear on platforms like GoDaddy or Namecheap and require bidding.
- Preparation: Check your domain research tool for auction icons and budget accordingly for competitive listings.
- History review: Use archive history, backlink tools, and search checks to confirm the domain was not used for spam.
- Topical fit: Choose a domain that matches your new directory topic. A relevant lower-metric domain can be safer than an unrelated high-metric domain.
Before buying, write down the exact site you plan to build on the domain. If you cannot clearly connect the old domain history to the new directory idea, keep looking. Relevance matters because the domain’s past signals should support the new site rather than confuse search engines and users.

Optimizing Your Directory for Launch
Refine your site before going live to ensure a professional experience for your users.
- Use consistent state names and city-parent relationships; update import mappings if labels differ.
- Replace theme demo logos and hero graphics with original or properly licensed assets.
- Fix CSS layout gaps and check focus states, image sizing, and small-screen spacing.
- Confirm that ACF and the listing post type plugin are active; keep the importer only if needed for updates.
Ask a qualified WordPress developer to review complex PHP, database, or security problems. AI-generated code should not be published solely because it renders without visible errors.
Before launch, check page speed, broken links, duplicate listings, empty archives, canonical URLs, XML sitemap inclusion, and accidental noindex settings. Publish an editorial policy, privacy notice, contact page, and a correction process. Clearly explain that a directory listing is informational and does not itself endorse a lawyer or create an attorney-client relationship.
Make Location Pages Useful for Search Visitors
Give each valuable state and city page a clear heading, short introduction, and relevant listings. Avoid publishing hundreds of near-empty location pages with only a city name changed. Link related locations naturally and keep filters and archive URLs consistent.
Use a sitemap and indexing settings that match the pages you actually want search engines to discover. Review performance and broken links after launch, then refresh business details when you have verified updates.
Note: Lawyer advertising and referral rules can vary by jurisdiction. Verify professional claims and directory descriptions, avoid unsupported rankings or endorsements, and review applicable data-source terms before publishing.
Monetizing and Growing the Directory
Scraped data alone will not rank or earn. These are the ways a directory becomes a business.
Make It More Useful Than the Scraped Source
A directory needs unique value to compete. Add information that visitors cannot get from a basic map listing. For each category, explain what users should compare, what questions they should ask, and which details matter before contacting a business.
- Add category buying guides, such as how to choose a dentist, plumber, daycare, gym, or hotel.
- Create neighborhood or city pages with local context.
- Use filters for price range, opening hours, services, location, accessibility, and appointment options.
- Allow users or editors to add reviews, notes, photos, and updates when appropriate.
- Highlight verified listings and explain what verification means.
- Remove closed businesses and outdated information on a regular schedule.
Pro Tip: Start with fewer categories and make those pages excellent. A small, accurate, helpful directory is stronger than a huge directory filled with thin or outdated listings.
Monetization Options That Fit Directories
Once your directory is live, plan how the site will grow. A directory can start as a simple listing platform, then expand into a lead-generation asset, advertising platform, or membership-based business.
You can monetize by offering premium listings, sponsored placements, featured business badges, display ads, lead forms, affiliate links, or paid submission options. Start with one simple monetization method, then add more once traffic and user demand increase.
Common Directory Monetization Options
- Featured listings: Businesses pay to appear above standard listings.
- Sponsored categories: A sponsor appears on category or location pages.
- Lead generation: Visitors submit quote requests that are routed to businesses.
- Display ads: Ads appear on high-traffic archive or listing pages.
- Affiliate links: Relevant tools or services earn commissions when visitors buy.
- Paid submissions: Businesses pay to submit or update their own listings.
Keep the user experience clear and honest. Label sponsored content where needed and avoid making paid listings look like unbiased rankings unless the ranking method is transparent.
Frequently Asked Questions
What is Sonnet 4?
Claude Sonnet 4 was an Anthropic AI model used for code generation and screenshot-guided design. Its original API model was retired on June 15, 2026. Use an available supported Sonnet model in your coding tool to follow this workflow.
Can Sonnet 4 create exact website clones?
An AI assistant can draft a site with similar navigation or card patterns, but you should not copy someone else’s protected assets or brand identity. A functional, original design also needs manual review and testing.
Do I need to know how to code?
You can start with basic WordPress skills, but you still need to review generated code, activate plugins, configure fields and taxonomies, test imports, and fix any errors. A developer can help with advanced security and PHP issues.
Is this method limited to law firm directories?
No. The same WordPress structure can support restaurant, contractor, or other directories. Change the listing fields and taxonomy design, and make sure your source data can be used for that purpose.
Why should I use an XLSX importer instead of adding listings manually?
An XLSX-compatible importer can create or update many listings at once. Depending on the plugin and add-ons, it may also map custom fields, taxonomies, and images. Always test a small batch and use a stable ID to avoid duplicates.
What should I check before publishing the directory?
Check listing accuracy and permissions, archive pages, search filters, contact links, mobile display, accessibility, duplicate records, plugins, backups, and your site’s privacy and correction policies.
Conclusion
A Claude coding assistant, custom WordPress theme, ACF, and a careful spreadsheet import can reduce repetitive setup work. You still need to verify every important code path, ensure your dataset is publishable, and check that visitors can find accurate listings.
Start with one state and a small, permission-cleared dataset. Build and test that pilot before expanding the directory to more cities or states.
Last Updated on November 8, 2026 by Logan Carter




Comments