Finding your next read
Practical craft for people building for the web.
Explore DevelopmentFinding your next read
THE FINDERPRESS TOOL DIRECTORY
Explore this tool and check the official listing for its latest features and requirements.
01 / SOURCE DETAILS
Run WordPress on SQLite. The SQLite plugin is a community, feature plugin. The intent is to allow testing an SQLite integration with WordPress and gather feedback, with the goal of eventually landing it in WordPress core. The plugin replaces the default MySQL database layer with an SQLite-backed implementation. WordPress continues to use its standard wpdb API while the plugin translates and emulates MySQL queries for SQLite. What the plugin provides No database server. Your site’s data is stored in a local SQLite database. Guided setup. The installation screen checks for the required PHP extension, write access, and conflicting database drop-ins before enabling SQLite. Purpose-built compatibility. A MySQL parser and emulation layer adapt MySQL syntax and behavior for SQLite. Useful diagnostics. SQLite details appear in Site Health, and Query Monitor is supported. Important: Enabling SQLite creates a separate, empty database; it does not migrate an existing site. If you enable it on a site that uses MySQL or MariaDB, WordPress will ask you to set up the site again. Disabling the plugin reconnects WordPress to the previous database with its data unchanged. Changes made while using SQLite are not transferred. The plugin requires the PDO SQLite PHP extension and SQLite 3.37.0 or newer.
02 / SOURCE DETAILS
What is the purpose of this plugin? The primary purpose of the plugin is to test WordPress with SQLite and gather feedback, with the goal of eventually including the integration in WordPress core. Read the original proposal on the Make WordPress Core blog and the call for testing for more context. Can I use this plugin on my production site? Yes, but keep reliable backups and make sure SQLite is a good fit for your site’s traffic. SQLite supports concurrent reads but allows only one writer at a time, so MySQL or MariaDB may be a better fit for sites with heavy concurrent write traffic. Test your workload, themes, and plugins before switching. Will this plugin migrate my existing site to SQLite? No. Enabling SQLite starts a fresh WordPress installation in a separate database. Your existing MySQL or MariaDB database remains unchanged, but its content is not copied to SQLite. Disabling the plugin reconnects WordPress to the previous database. Content created while using SQLite is not transferred back. Where is the SQLite database stored? By default, the SQLite database is stored in a randomized path under WP_CONTENT_DIR . '/database' . The full path is recorded in db-path.php and exposed by the DB_PATH constant at runtime. For example: Database path: WP_CONTENT_DIR . '/database/.ht.020a33c5d9e5407e8e93b43e55abf62e/.ht.sqlite' Recorded in: WP_CONTENT_DIR . '/database/db-path.php' as return __DIR__ . '/...'; Exposed by: DB_PATH The random path makes the database location difficult to guess when it is not otherwise protected. We recommend setting DB_PATH to an explicit, protected path outside the web root that your web server does not expose. Integrations should always read DB_PATH after WordPress loads instead of assuming a fixed database path. How can I configure the database location? To properly secure the SQLite database , define the DB_PATH constant to an explicit path that is protected from public web access. An explicit DB_PATH value is used as-is without randomization. Define it in wp-config.php : // Use protected DB path that is not exposed by the web server. define( 'DB_PATH', '/private/wordpress/database.sqlite' ); Caution: An explicit DB_PATH must point to a protected location that your web server does not expose. Store the database outside the web root and make sure it’s protected. The value of DB_PATH must be an absolute path to the SQLite database file, or :memory: for an in-memory SQLite database. The database directory must be writable by PHP. Changing DB_PATH selects a different database without moving an existing one. What does the plugin require? In addition to the WordPress and PHP versions listed above, the plugin requires the PDO SQLite PHP extension and SQLite 3.37.0 or newer. The setup screen also needs write access to the wp-content directory and will detect conflicting database drop-ins. Where can I submit my plugin feedback? Feedback helps improve the integration. For troubleshooting, questions, suggestions, or feature requests, open an issue in the SQLite GitHub repository . How can I contribute to the plugin? Contributions are welcome through the SQLite Database Integration repository on GitHub . Does this plugin change how WordPress queries are executed? Yes. The plugin replaces the default MySQL-based database layer with an SQLite-backed implementation. WordPress continues to use the wpdb API, while queries are internally adapted to SQLite syntax and behavior.
KEEP EXPLORING