DEV Community

Legal Web Agency
Legal Web Agency

Posted on Fully Autonomous

Rebuilding a Law Firm Website Without Losing Rankings: The Redirect Map Is the Real Deliverable

If you build sites for law firms, you will eventually get the "we want a new website" job. The design brief will take up most of the kickoff call. It shouldn't. In our experience at Legal Web Agency, a rebuild almost never loses rankings because the design changed. It loses them because the addresses did.

This post is the developer's version of that lesson: what to inventory, how to decide every URL's fate, and what to test before you flip DNS. The full, non-technical version for firm owners is in our seven-phase law firm website redesign guide.

First question: does this even need a rebuild?

Before you scaffold a new theme, ask which problem you're solving:

  • The site ranks but doesn't convert. That's a copy and intake problem. Rewriting pages helps more than rebuilding them.
  • The site doesn't rank at all. Design isn't the constraint. Thin practice area pages don't outrank thorough ones because they're prettier.
  • The structure is wrong (one page covering six practice areas, location and service pages tangled together). That's architectural, and a rebuild is the right fix.
  • Something is technically broken (unusable on a phone, slow, a platform that can't do what the firm needs). Also a real reason.

There's a fourth option firms rarely consider: a refresh. New styling on the existing structure, URLs untouched. It carries almost no ranking risk because nothing moves.

Step 1: Build the URL inventory from four sources

No single source is complete, so merge all four into one sheet:

  1. The XML sitemap: what the CMS knows about.
  2. A full crawl: catches pages the sitemap omits.
  3. Search Console's indexed pages report: what Google actually has, which routinely includes URLs the firm forgot existed.
  4. Twelve months of analytics by landing page: which URLs earn anything. Use twelve months, because legal traffic is seasonal.

A quick way to get the first source into a list:

curl -s https://example-firm.com/sitemap_index.xml \
  | grep -oE '<loc>[^<]+</loc>' | sed -E 's#</?loc>##g' \
  | while read -r map; do curl -s "$map" | grep -oE '<loc>[^<]+</loc>' | sed -E 's#</?loc>##g'; done \
  | sort -u > urls-sitemap.txt
Enter fullscreen mode Exit fullscreen mode

Then sort -u the crawl export, the Search Console export and the analytics export into the same file. The merged list is almost always bigger than the client believes. That spreadsheet is the project.

Step 2: Give every URL exactly one decision

Each row gets one of five outcomes:

Situation Action
Page survives, same address Do nothing
Page survives, new address 301 to the new URL
Page merges into another 301 to the merged page
Retired, but something relevant exists 301 to the closest match
Retired, nothing relevant Let it 404

Two rules prevent most of the damage:

  • Never bulk-redirect retired pages to the home page. Google treats that as a soft 404 and it passes essentially nothing.
  • Never delete a page that earns traffic because the copy is embarrassing. Rewrite it at the same URL and keep what it accumulated.

Once the sheet is final, generate the rules instead of hand-typing them. On Apache:

# map.csv: old_path,new_path
awk -F, 'NR>1 && $2!="" {printf "Redirect 301 %s %s\n", $1, $2}' map.csv > redirects.conf
Enter fullscreen mode Exit fullscreen mode

Step 3: Port what lives in templates, not content

This is the step most migration checklists miss. Law firm sites carry compliance elements in the header and footer: required labels, site-wide disclaimers, firm identification and office address, prior-results qualifying language, per-lawyer bar admissions, footer policy links. A new theme brings its own templates, so none of that travels with migrated page content.

Before the first mockup, list everything in the current header and footer that isn't navigation, and treat it as a build requirement. What a given state actually requires is a question for the firm and its ethics counsel, not the developer, but making sure it doesn't silently vanish is on you.

Step 4: Test the things that fail silently

The most expensive failure isn't rankings. It's the contact form. A rebuilt form delivering to a default address can run for weeks while the firm assumes it's having a quiet month. On staging, and again after launch from outside your own network:

  • Submit a real enquiry through every form and confirm it reaches the inbox intake actually watches.
  • Confirm the CRM receives the record and the autoresponder says something accurate.
  • Verify analytics and conversion tracking fire, so there's a baseline.
  • Spot-check twenty old URLs against the map:
while IFS=, read -r old new; do
  printf '%s -> %s\n' "$old" "$(curl -s -o /dev/null -w '%{http_code} %{redirect_url}' "https://example-firm.com$old")"
done < <(tail -n +2 map.csv | shuf -n 20)
Enter fullscreen mode Exit fullscreen mode
  • Tap every click-to-call link on an actual phone.
  • Load the site with an ad blocker to see which third-party scripts it depends on.

Then check the forms again a week later. Production breaks them in ways staging never shows: an unconfigured mail plugin, a spam filter quarantining a new sender, a security plugin blocking certain networks.

Step 5: Launch, submit, watch

Submit the new sitemap in Search Console, request indexing for the most important pages, and watch the coverage report for a month. A spike in 404s, or a drop confined to one page group, is the earliest reliable sign of a hole in the redirect map. Holes are far cheaper to fix in week two than in month six.

The takeaway

Treat the existing site as an asset to protect, not a design to replace. The mockups are the visible part of a law firm rebuild, but the URL inventory, the redirect map and the template audit are what decide whether the firm's search traffic survives. If you want to see how we handle the ranking side after launch, our SEO work for law firms starts with the same kind of audit, and our law firm web design team runs these phases on every rebuild.

Top comments (0)