Wordpress integration with Wp solr
WordPress + Opensolr
WordPress's built-in search is basic — it runs raw SQL queries against your database, with no relevance scoring, no fuzzy matching, no autocomplete, and terrible performance on large sites. Replacing it with Solr gives you a real search engine that scales to hundreds of thousands of posts.
The WPSolr Plugin
The recommended way to connect WordPress with Opensolr is through the WPSolr plugin. It replaces WordPress's default search entirely and sends all queries to your Opensolr Index instead.
What WPSolr Does
- Replaces WordPress search — both frontend and admin search use Solr instead of SQL
- Real-time autocomplete — suggestions appear as users type in the search box
- Faceted navigation — filter results by category, tag, custom taxonomy, price range, date, and more
- WooCommerce support — search products by SKU, attributes, price, and custom fields
- Custom field indexing — index any post type, taxonomy, or custom field you choose
- One-click indexing — index, re-index, or clear your data with a single button
Setup Steps
Step 1: Create Your Opensolr Index
- Log in to your Opensolr Dashboard
- Create a new Opensolr Index
- Note your hostname and credentials from the control panel
Step 2: Install WPSolr
Install the WPSolr plugin in WordPress:
# Via WP-CLI wp plugin install wpsolr-free --activate # Or via composer composer require developer-starter/wpsolr-free
Or download it from the WordPress Plugin Directory and upload via the WordPress admin.
Step 3: Connect to Opensolr
- Go to WPSolr in your WordPress admin menu
- Select Apache Solr as your search engine
- Enter your Opensolr connection details:
| Setting | Value |
|---|---|
| Solr host | Your hostname from Opensolr (e.g., useast94.solrcluster.com) |
| Solr port | 443 |
| Solr path | /solr/your_core_name |
| Use HTTPS | Yes |
| Authentication | Your Opensolr username and password |
- Click Test Connection — you should see a success message
Step 4: Configure What to Index
In the WPSolr settings, choose:
- Post types to index (posts, pages, products, custom types)
- Taxonomies to index (categories, tags, custom taxonomies)
- Custom fields to include in search
- Attachments to index (PDF, DOC, etc.)
Step 5: Index Your Content
Click the Index button in WPSolr. The plugin sends all your WordPress content to your Opensolr Index. For large sites, indexing runs in batches automatically.
WooCommerce Search
If you run a WooCommerce store, WPSolr with Opensolr gives you powerful product search:
- Search by SKU, name, description, and attributes
- Faceted filtering by price range, category, color, size
- Autocomplete product suggestions with images
- Sorting by price, popularity, rating, or relevance
Quick Checklist
- Install the WPSolr plugin from the WordPress Plugin Directory
- Create an Opensolr Index and note your hostname and credentials
- Configure the connection in WPSolr settings (host, port 443, HTTPS, auth)
- Select which post types and fields to index
- Click Index to send your content to Solr
- Test your search to verify results are coming from Solr
Need help connecting WordPress to Opensolr? Reach out to us at support@opensolr.com — we will walk you through the setup.