Schema & Settings
Configure global business information, schema markup settings, and social profiles with media library integration
Overview
The Schema & Settings tab is where you configure your primary business information that applies globally across all locations. This includes organization details, default schema settings, map integration, opening hours format, and social profiles. All settings are saved via WordPress options API with proper sanitization.
Settings Registration
// Registered in UnifiedLocalSeo.php
register_setting('prorank_local_seo', 'prorank_local_seo_settings', [
'sanitize_callback' => [$this, 'sanitize_settings']
]);Entity Information
The Entity Information section determines how your organization is represented in schema markup:
| Setting | Type | Description | Default |
|---|---|---|---|
| Entity Type | Select | Organization or Person | organization |
| Website Name | Text | Main site name/title | |
| Organization Name | Text | Legal business name | |
| Organization URL | URL | Main website URL | |
| Organization Logo | Media Picker | Business logo from media library |
- Visual preview of selected logo
- "Select from Media Library" button opening wp.media modal
- "Remove Logo" button to clear selection
- Manual URL input as alternative option
Business Details
Configure your primary business contact information and address:
| Setting | Type | Description | Required |
|---|---|---|---|
| Business Email | Primary contact email | No | |
| Business Phone | Tel | Primary phone number | No |
| Street Address | Text | Physical street address | No |
| City | Text | City name | No |
| State/Region | Text | State or province | No |
| Postal Code | Text | ZIP or postal code | No |
| Country | Select | Country selection (US, CA, GB, AU, etc.) | No |
Default Schema Settings
Configure default settings for all locations:
| Setting | Type | Description | Options |
|---|---|---|---|
| Default Business Type | Select | Default schema.org type for new locations | LocalBusiness, Restaurant, Store, Hotel, MedicalBusiness, ProfessionalService |
| Use Multiple Locations | Toggle | Enable multi-location management | On/Off |
| All Locations Same Organization | Toggle | All locations belong to same org | On/Off |
Map Integration
Configure map provider and display settings:
| Setting | Type | Description | Default |
|---|---|---|---|
| Map Provider | Select | Choose map service | Google Maps / OpenStreetMap / Mapbox |
| Google Maps API Key | Text | Required for Google Maps | |
| Enable Location Detection | Toggle | Allow user location detection | true |
| Show Map | Toggle | Display map on frontend | true |
| Show Directions | Toggle | Show directions button | true |
Social Profiles
Add your social media profiles for enhanced schema markup:
| Platform | Type | Example | Schema Property |
|---|---|---|---|
| Facebook URL | URL | https://facebook.com/yourbusiness | sameAs |
| Twitter URL | URL | https://twitter.com/yourbusiness | sameAs |
| Instagram URL | URL | https://instagram.com/yourbusiness | sameAs |
| LinkedIn URL | URL | https://linkedin.com/company/yourbusiness | sameAs |
| YouTube URL | URL | https://youtube.com/c/yourbusiness | sameAs |
Social profiles are included in the organization schema as "sameAs" properties, helping search engines understand your brand presence across platforms.
Media Library Picker Implementation
The media library picker is implemented using WordPress's built-in wp.media API:
// Implementation in local-seo.js (lines 8-95)
$('.select-logo-btn').on('click', function(e) {
e.preventDefault();
// Create the media uploader
mediaUploader = wp.media({
title: 'Select Organization Logo',
button: { text: 'Use This Logo' },
library: { type: 'image' },
multiple: false
});
// When image is selected
mediaUploader.on('select', function() {
var attachment = mediaUploader.state()
.get('selection').first().toJSON();
// Update preview
$('#logo-preview-image').attr('src', attachment.url).show();
$('.no-logo-placeholder').hide();
// Update hidden fields
$('#organization_logo').val(attachment.url);
$('#organization_logo_id').val(attachment.id);
});
mediaUploader.open();
});The selected logo is saved with both URL and attachment ID for flexibility. The media library is properly enqueued with wp_enqueue_media() in the UnifiedLocalSeo class.
Business Details
Configure your primary business contact information and address:
Address Fields
- Business Email: Sanitized with
sanitize_email() - Business Phone: Sanitized with
sanitize_text_field() - Street Address: Full street address including number
- City, State, Postal, Country: Complete address components
- Price Range: $ to $$$$ indicators for service pricing
Default Schema Settings
Configure default settings for new locations and schema behavior:
Default Business Type
Select from 30+ LocalBusiness schema types. This becomes the default for new locations but can be overridden per location.
Multiple Locations
Enable if you have multiple business locations. When checked, shows the multi-location management section with import/export tools.
!empty($input['use_multiple_locations'])Map Integration Settings
Configure how maps are displayed and integrated across your locations:
| Setting | Purpose | Default | Type |
|---|---|---|---|
| Map Provider | Select mapping service | Google Maps | Select |
| Google Maps API Key | Enable interactive maps | None | Text |
| Map Style | Visual appearance | Roadmap | Select (Roadmap/Satellite/Hybrid/Terrain) |
| Max Locations | Limit on store locator | 10 | Number (absint) |
| Directions Label | Button text | Get Directions | Text |
| Location Detection | Allow geolocation | Disabled | Checkbox |
| Enhanced Search | Advanced filtering | Disabled | Checkbox |
// Sanitization in sanitize_settings()
$sanitized['google_maps_api_key'] = sanitize_text_field($input['google_maps_api_key'] ?? '');
$sanitized['max_locations'] = absint($input['max_locations'] ?? 10);
$sanitized['enable_location_detection'] = !empty($input['enable_location_detection']);Opening Hours Configuration
Set default display formats for opening hours across all locations:
Time Format
- • 12-hour (AM/PM) - e.g., 9:00 AM - 5:00 PM
- • 24-hour - e.g., 09:00 - 17:00
Special Labels
- • Closed Label: "Closed"
- • 24/7 Label: "Open 24/7"
- • 24 Hours Label: "Open 24 hours"
KML Sitemap Settings
Enable KML (Keyhole Markup Language) sitemap generation for Google Maps integration:
Implementation Details
- ✓URL Rewrite: Registered at
/locations.kmladd_rewrite_rule('^locations.kml$', 'index.php?prorank_kml=1', 'top'); - ✓Output Format: Valid KML 2.2 with Placemark elements for each location
- ✓Requirements: Only includes locations with valid latitude/longitude coordinates
- ✓Content Type:
application/vnd.google-earth.kml+xml
Schema Validation
The Schema Validation section provides real-time validation of your configuration:
Validation Process
- Click "Run Validation" button
- AJAX call to
prorank_validate_schema - Server checks all settings and locations
- Returns categorized results:
- Errors - Critical issues that must be fixed
- Warnings - Recommendations for improvement
- Checks - Passed validation items
- Auto-validates on page load after 1 second delay
// Auto-validation on page load
setTimeout(validateSchema, 1000);
// Manual validation
$('#validate-schema-btn').on('click', validateSchema);Social Profiles
Add your social media URLs to enhance your online presence and schema markup:
| Platform | Field Name | Example | Sanitization |
|---|---|---|---|
| facebook_url | https://facebook.com/yourpage | esc_url_raw() | |
| Twitter/X | twitter_url | https://twitter.com/yourhandle | esc_url_raw() |
| instagram_url | https://instagram.com/yourhandle | esc_url_raw() | |
| linkedin_url | https://linkedin.com/company/yourcompany | esc_url_raw() | |
| YouTube | youtube_url | https://youtube.com/c/yourchannel | esc_url_raw() |
Social profiles are added to the schema markup as sameAs properties, helping search engines verify your brand's online presence.
Form Submission
The settings form submits to WordPress's standard options.php handler:
<form id="prorank-local-seo-form" method="post" action="options.php">
<?php settings_fields('prorank_local_seo'); ?>
<!-- Form fields -->
<?php submit_button('Save Settings', 'primary large'); ?>
</form>sanitize_settings()which applies appropriate sanitization for each field type.Important Pages Selection
Select important pages for enhanced schema context:
Page Dropdowns
Uses WordPress's wp_dropdown_pages() function to generate select lists of all published pages.
- • About Page: Your about us or company information page
- • Contact Page: Primary contact information page
Page IDs are saved as integers using absint()