b6df4dbb92
MLS plugin fixes from this session: - Fix silent insert failures: location column NOT NULL was rejecting wpdb->insert calls, causing ~18k new properties since Dec 2025 to be lost. Inserts now build raw SQL with ST_PointFromText so the spatial column is populated atomically. - Auto-refresh expired media URLs in MLS_Media_Handler::fetch_and_cache(), guarded by a property-level GET_LOCK so concurrent fetches share one API refresh. - Normalize WP_Error to null in mls_get_property_image() so callers can rely on the documented string|null contract. - Support comma-separated property_type filters in MLS_Query and MLS_Cluster so the homepage "View All Commercial" link (?property_type=Commercial+Sale,Land,Farm) actually filters correctly. - Incremental sync now looks back 10 minutes past the latest modification timestamp as a safety margin against missed records. - Smart sync exits silently (info-level, not warning) when a full sync is in progress. Operational: - New cron: weekly full sync Sundays at 3 AM (/usr/local/bin/mls-full-sync). - New cron: hourly 2GB cap on mls-thumbnails/ and cache/transformed-images/ (/usr/local/bin/mls-image-cache-cap). - Logrotate config for wp-content/debug.log (2-day retention, daily rotation, delaycompress). Repo policy: - CLAUDE.md updated with explicit "commit everything except build artifacts" policy. - .gitignore: untrack runtime image caches and debug.log rotations. Other modifications in this snapshot are pre-existing in-flight theme/plugin/db_content_updates work. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
3.4 KiB
Executable File
3.4 KiB
Executable File
Database Content Update: SEO - Albert Lea Landing Page
Date: 2026-01-05 Author: Claude (automated) Summary: Configure Albert Lea page as SEO landing page with city template
Overview
This update configures the existing Albert Lea page (ID 15) as an SEO-optimized city landing page that displays MLS listings for Albert Lea.
Changes Made
1. Update Albert Lea Page Slug
Change the URL from /albert-lea/ to /albert-lea-homes/ for better SEO targeting.
UPDATE wp_posts
SET post_name = 'albert-lea-homes'
WHERE ID = 15;
WP-CLI Alternative:
wp post update 15 --post_name=albert-lea-homes --allow-root
2. Set Page Template
Assign the City Landing Page template to the Albert Lea page.
-- First check if template meta exists
SELECT * FROM wp_postmeta WHERE post_id = 15 AND meta_key = '_wp_page_template';
-- If exists, update:
UPDATE wp_postmeta
SET meta_value = 'page-city-landing.php'
WHERE post_id = 15 AND meta_key = '_wp_page_template';
-- If not exists, insert:
INSERT INTO wp_postmeta (post_id, meta_key, meta_value)
VALUES (15, '_wp_page_template', 'page-city-landing.php');
WP-CLI Alternative:
wp post meta update 15 _wp_page_template page-city-landing.php --allow-root
3. Add Yoast SEO Meta
Add optimized meta title and description for the page.
INSERT INTO wp_postmeta (post_id, meta_key, meta_value) VALUES
(15, '_yoast_wpseo_title', 'Albert Lea Homes for Sale | HomeProz Real Estate'),
(15, '_yoast_wpseo_metadesc', 'Find homes for sale in Albert Lea, MN. Browse current listings, view property details, and connect with local real estate experts at HomeProz.');
WP-CLI Alternative:
wp post meta add 15 _yoast_wpseo_title "Albert Lea Homes for Sale | HomeProz Real Estate" --allow-root
wp post meta add 15 _yoast_wpseo_metadesc "Find homes for sale in Albert Lea, MN. Browse current listings, view property details, and connect with local real estate experts at HomeProz." --allow-root
4. Flush Rewrite Rules
Required after changing page slugs to update permalinks.
wp rewrite flush --allow-root
Dependencies
- Theme files must be deployed first:
wp-content/themes/homeproz/page-city-landing.phpwp-content/themes/homeproz/page-city-landing.scsswp-content/themes/homeproz/inc/yoast-seo.phpwp-content/themes/homeproz/inc/acf-fields.php(updated)wp-content/themes/homeproz/functions.php(updated)wp-content/themes/homeproz/dist/(rebuilt assets)
Verification
After applying changes, verify:
-
Page loads correctly:
https://[domain]/albert-lea-homes/ -
Template is active:
wp post meta get 15 _wp_page_template --allow-root # Should output: page-city-landing.php -
Yoast meta is set:
wp post meta get 15 _yoast_wpseo_title --allow-root wp post meta get 15 _yoast_wpseo_metadesc --allow-root -
MLS sitemap accessible:
https://[domain]/mls-listings-sitemap.xml
Rollback
To revert these changes:
-- Restore original slug
UPDATE wp_posts SET post_name = 'albert-lea' WHERE ID = 15;
-- Remove template assignment
DELETE FROM wp_postmeta WHERE post_id = 15 AND meta_key = '_wp_page_template';
-- Remove Yoast meta
DELETE FROM wp_postmeta WHERE post_id = 15 AND meta_key IN ('_yoast_wpseo_title', '_yoast_wpseo_metadesc');
Then flush rewrite rules:
wp rewrite flush --allow-root