How to delete entities quickly ?

I disabled The Wire plugin, but the thewire entities are not deleted. They are still appeared on Search page (when the keyword is relevant). How to delete all TheWire entities quickly ?

  • To fetch and delete all wire postings it's best to write and execute a little php script that uses the Elgg API functions. Don't try to get rid of the wire postings by deleting stuff directly from the database because there would likely remain entries formerly connected with the deleted entries and in the worst case you break your database consistency.

    A script to find and delete wire postings can look like

    $autoload_path = __DIR__ . '/vendor/autoload.php';
    $autoload_available = include_once($autoload_path);
    if (elgg_is_admin_logged_in()) {
        $access = elgg_set_ignore_access(true);
        $access_status = access_get_show_hidden_status();
        $entities = new ElggBatch('elgg_get_entities', array(
            'type' => 'object',
            'subtype' => 'thewire',
            'limit' => false,
        $count = 0;
        foreach ($entities as $entity) {
    echo "Found and deleted " . $count . " wire postings.";

    Save it for example as wire_delete.php in the root folder of your Elgg installation and then call it in your browser while logged in as admin (url: and the wire entities will get deleted.

    In case you are still on Elgg 1, replace the lines

    $autoload_path = __DIR__ . '/vendor/autoload.php';
    $autoload_available = include_once($autoload_path);


    require 'engine/start.php';