We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 30086
    • 110 Posts
    Hi

    I would like to know how to delete one resource only without clicking the "Purge deleted resources".
    I noticed if you do that, all the other resources will be deleted as well.

    I just would like to delete that particular resource it is possible?

    Thanks
      • 22427
      • 793 Posts
      You can delete that single resource from the database, using f.e. [tt]phpMyAdmin[/tt] .
      Open the table [tt]modx_site_content[/tt] (or whatever is your prefix), look for the record of the wanted resource and delete it.
        • 30086
        • 110 Posts
        I see so I have to login to the database and delete it from there?
          • 3749
          • 24,544 Posts
          If you’re using Revolution, this snippet would do it:

          $resource = $modx->getObject('modResource', ##);  // replace ## with the ID of the resource
          $resource->remove();
          


          Be careful, though, the resource is gone for good once it executes.

            Did I help you? Buy me a beer
            Get my Book: MODX:The Official Guide
            MODX info for everyone: http://bobsguides.com/modx.html
            My MODX Extras
            Bob's Guides is now hosted at A2 MODX Hosting