I recently created a 147 page site. The first thing I did was create all the pages in the Pages Management, which makes it really easy to stub out the entire site. Took about 5 minutes to create 147 blank pages. In turn it created 147 HTML modules as well, because by default DNN adds a blank module to a new page.

I wanted to remove those so that when the content authors would go to add content to the page, they would select a new module, select the container and place it in the appropriate pane. Having a blank module on the page already added confusion to the process.

I created a SQL script to run through and remove those modules from the pages.

Update tabmodules
set IsDeleted = 1
Where TabModuleId in (select a.tabmoduleid from tabmodules a
inner join modules b on a.ModuleId = b.ModuleId
where b.ModuleDefID = 111
and a.ModuleTitle = 'Enter Title'
and LastContentModifiedOnDate < '6/15/2012') 

 

So this is removing any HTML modules that had a default title 'Enter Title' and were created on the date I started building the site. However, after running this query, you have to clear the cache/restart the app.

Warning, this running under the assumption that you are adding titles to modules. If you are using containers that don't display the title, you may have some modules with content and not title hanging around.