Nástroj pro přesun WordPressu jinam

When you’re migrating WordPress (or any other platform using serialized PHP strings in the database) between domains, you must use a safe search and replace method that preserves the integrity of the serialized string lengths. A simple of a dump file for http://localhost to, for example, http://thenewdomain.com is problematic because the length of the string changes but the indexes for the serialized strings does not. Consequently settings are lost and widgets disappear. Not good.

This script can now also handle multiply nested serializations, which can happen in transient values in WP at times, and it can also handle multi-byte Unicode changes safely. This is important now that internationalised domain names are allowed.

It’s worth mentioning that the code will work for any platform that stores PHP serialized arrays in a MySQL database. You can easily use this script on Drupal, Joomla and many other systems where you need to change items across a database without messing up your stored arrays.

Search & Replace DB »


How to Move WordPress to a New Server (without losing anything)

Struktura databáze WordPressu

Pokud chcete pochopit, jak vlastně samotný WordPress funguje, určitě vám pomůže základní znalost struktury jeho databáze. Ta se zkládá z celkem 11 tabulek, které ještě mohou rozšiřovat pluginy. Každá má svůj prefix, nejčastěji wp_, který se nastavuje běhěm instalace WordPressu a vytváření databáze. comments, commentmeta První dvě tabulky obsahují informace o komentářích na webu. V [...]

Práce s databází pomocí třídy $wpdb

Načtení ID a nadpisů čtyř nejnovějších příspěvků a jejich seřazení podle počtu komentářů (sestupně):

   $posts = $wpdb->get_results("SELECT ID, post_title FROM $wpdb->posts WHERE post_status = 'publish'
   AND post_type='post' ORDER BY comment_count DESC LIMIT 0,4")

   // Echo the title of the first scheduled post
   echo $posts[0]->post_title;

Objekt $results obsahuje pole s výsledky.

get_row načte pouze jediný záznam z tabulky:

   $posts = $wpdb->get_row("SELECT ID, post_title FROM wp_posts WHERE post_status = 'publish'
   AND post_type='post' ORDER BY comment_count DESC LIMIT 0,1")

   // Echo the title of the most commented post
   echo $posts->post_title;

get_col načte celý sloupec:

   $posts = $wpdb->get_col("SELECT ID FROM wp_posts WHERE post_status = 'publish'
   AND post_type='post' ORDER BY comment_count DESC LIMIT 0,10")

   // Echo the ID of the 4th most commented post
   echo $posts[3]->ID;

get_var načte jedinou hodnotu:

   $email = $wpdb->get_var("SELECT user_email FROM wp_users WHERE user_login = 'danielpataki' ")

   // Echo the user's email address
   echo $email;

Vkládání do databáze

   // syntaxe: $wpdb->insert( $table, $data, $format);
   $wpdb->insert($wpdb->usermeta, array("user_id" => 1, "meta_key" => "awesome_factor", "meta_value" => 10), array("%d", %s", "%d"));

   // odpovídá:
   // INSERT INTO wp_usermeta (user_id, meta_key, meta_value) VALUES (1, "awesome_factor", 10);

Updatování databáze:

// $wpdb->update($table, $data, $where, $format = null, $where_format = null);

// $where parameter - can be an array in the form of column-value pairs:
$wpdb->update( $wpdb->posts, array("post_title" => "Modified Post Title"), array("ID" => 5), array("%s"), array("%d") );

Zdroj »

Databázové aplikace

WP CSV to Database

WP CSV to Database plugin allows you to insert CSV file content into WordPress database. Useful when you want to bulk upload data from your CSV file (e.g. product details) to the WordPress database in one go.

DB Toolkit

DB-Toolkit allows you to build web applications within WordPress. From manager interfaces to capture forms to content viewers or almost any type. DB-Toolkit is not a simple plugin and has a steep learning curve, but the results are very rewarding.

Some Features:

  • Field-by-field data type handling makes data management very powerful and flexible.
  • Data exporting in PDF and CSV * Create API's to connect to your data. This allows you to build mobile apps that feed from your content.
  • Multi Interface Layouts using clusters * Build custom content managers, like galleries, contact lists, application forms, employee databases... and so on.
  • Import data from an XML or CSV source * Visually build forms that capture data to a database existing or not.

Database Table Manager

Want to add and manage custom database tables from the admin area? This plugin contains several easily modified examples. This plugin folder contains 2 suites of plugins. The Club Manager Plugin contains 4 Plugins - Programme (of Events), Stop Press, Recent Events and News. The Specialists Plugin contains a more generic example of the management of a many to many link table between a number of "specialists" and their "specialisms". It also demonstrates the use of left joins and lookup tables. Code to sort data by clicking on the table head and to filter the selection set has also been added. They are based upon a more generic system which allows creating and adding data to custom database tables from the wordpress control panel. These plugins can be used as a template for creating different types of table and display or you can just use them as they are if they do what you want to do.

[GWA] db Editor

A dangerously powerful plugin that will allow you to access and update your database tables in your weblog administrator. Uses AJAX and TableKit to update field data. Simple and fast. Just click, edit, and submit.

Jak zjednodušit databázové dotazy když nepotřebujete stránkování?

Chystaný WordPress 3.2 se zaměřuje hlavně na optimalizaci a zrychlení načítání webu a v této souvislosti byl objeven docela zajímavý trik. Jde o „neveřejný“ parametr no_found_rows, který může být využit např. ve funkcích query_posts(), WP_Query() či get_posts(), ale skoro nikdo o něm neví a moc se nepoužívá, i když dokáže v mnoha případech zjednodušit některé prováděné [...]

Údržba systému a databáze


WP-Sweep allows you to clean up unused, orphaned and duplicated data in your WordPress. It also optimizes your database tables.
Autorem tohoto pluginu je Lester Chan, což je určitou zárukou kvality.


WP CleanFix

WP CleanFix is a management tool for for check, repair, fix and optimize your WordPress blog. The Ajax interface allow to manage all status in one only page!


  • Database Tables optimization
  • Check/Remove for unused UserMeta
  • Check/Remove for Post Revision and Trash
  • Check/Remove for unused Post Meta
  • Check/Remove for unused Tags
  • Check/Remove/Relink for Posts without Authors
  • Check/Remove/Relink for Pages without Authors
  • Check/Remove for Attachments without Post/Page
  • Check/Remove for unused Categories
  • Check/Remove for unlink Categories (terms)
  • Check/Remove for unlink Categories Taxonomy
  • Check/Remove for unapproved and Trash comments
  • Check/Remove for spam comments
  • Find & Replace on Posts Content
  • Find & Replace on Comments Content
  • WordPress MU compatibility
  • English/French/I­talian Localization
  • Added Bubble repair count on item menu

10 Quick Ways to Clean Up and Optimize Your WordPress Site »

Zálohování a obnova

UpdraftPlus Backup and Restoration

Simplifies backups (and restoration). Backup into the cloud (Amazon S3 (or compatible), Dropbox, Google Drive, Rackspace Cloud, DreamObjects, FTP, SFTP, SCP, WebDAV, OpenStack Swift and email) and restore with a single click. Backups of files and database can have separate schedules.

UpdraftPlus is the highest-ranking backup plugin on rankwp.com (ranks in the top 40 out of 30,000 WordPress plugins for quality on rankwp.com - last checked 21 September 2014).

Widely tested and reliable (over 1.8 million downloads). Ranks in the top 100 most used of all WordPress plugins on rankwp.com. Millions of backups completed!


XCloner - Backup and Restore

XCloner is a Backup and Restore component designed for PHP/Mysql websites, it can work as a native plugin for WordPress and Joomla!.

XCloner design was specifically created to Generate custom backups of any LAMP website through custom admin inputs, and to be able to Restore the clone on any other location with the help of the automatic Restore script we provide, independent from the main package!

XCloner Backup tool uses Open Source standards like TAR and Mysql formats so you can rest assured your backups can be restored in a variety of ways, giving you more flexibility and full control.

XCloner Generate, Move and Restore process:

  1. Generate and Store the backups
  2. Move the backup and restore script to the new location
  3. Restore the backup by launching the XCloner.php restore script


The Duplicator plugin is designed to give WordPress Administrators the ability to migrate a site from one location to another location in 3 easy steps. Just create a package, download it and install. No need to change all your settings and re-run import/export scripts. The plugin also serves as a simple backup utility. This tool is great for pulling a production site down onto your local machine for testing and validation. It also works great for developing locally and then pushing up to a production server.

It reduces the process to three easy steps:

  1. Create a package
  2. Download
  3. Install in the new location

EZPZ One Click Backup http://wordpress.org/…lick-backup/

EZPZ One Click Backup is a very easy way to do a complete backup and restoring of your entire WordPress site. In fact it's so easy to use there are no required user settings, everything is automatic. Just one click and presto, you'll have a complete backup stored on your server. One more click and you can download the entire backup to your own computer.

If you prefer to download your backup via FTP the path you'll need is also included. EZPZ OCB also stores your last backup on the server in case you ever need to download it again.

With the new EZPZ Easy Restore restoring your site is a simple two step process.


Simple automated backups of your WordPress powered website. BackUpWordPress will back up your entire site including your database and all your files.

WordPress Database Backup

(Pouze) databázi lze zazálohovat manuálně uložením na server, vlastní počítač nebo posláním na email, ev. automaticky ve zvoleném intervalu.


Backup, restore, migrate your WP installation, both code and MySQL tables, with a single click.

WP Staging - DB & File Duplicator & Migration

This duplicator plugin allows you to create an staging or development environment in seconds. It creates a file clone of your website into a subfolder of your current WordPress installation with an entire copy of your database. This sounds pretty simple and yes it is! All the hard time consumptive database and file copy stuff including url replacements is done in the background. For testing new plugins and updates first before installing them on live website.

Údržba databáze


This WordPress plugin will cleanup your WordPress database, which means that it will perform the following actions:

  • Remove all post revisions
  • Remove all spam comments
  • Remove all unapproved comments
  • Remove all unused tags
  • Remove all unused post meta
  • Optimize MySQL tables by removing all unused table space

Optimize Database after Deleting Revisions

A 'One Click' WordPress Database Cleaner / Optimizer.

  • Deletes redundant revisions of posts and pages (you optionally can keep an 'x'-amount of the most recent revisions)
  • Deletes trashed posts, pages and comments (optional)
  • Deletes spammed comments (optional)
  • Deletes 'orphan postmeta items'
  • Optimizes the database tables (optionally you can exclude certain tables from optimization)
  • Creates a log file of the optimizations (optional)
  • Optimization can be scheduled to automatically run once hourly, twice daily, once daily or once weekly (optional)

Plugins Garbage Collector

Vymaže tabulky po deaktivovaných a nepoužívaných pluginech.