mfd/delete-hidden 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

mfd/delete-hidden

Composer 安装命令:

composer require mfd/delete-hidden

包简介

Soft-deletes hidden tt_content records older than N days, including recursive b13/container children.

README 文档

README

TYPO3 extension (v13.4+) that soft-deletes hidden tt_content records older than a configurable number of days, including their recursive b13/container children.

How it works

  1. FinderService queries tt_content for records where hidden = 1, t3ver_wsid = 0, and tstamp is older than the given threshold. Pages with tx_delete_hidden_exclude = 1 are skipped.
  2. CleanupService enforces a safety cap (default 500) and delegates all deletions to TYPO3's DataHandler — no direct SQL. Any DataHandler error aborts the run immediately.
  3. CleanupCommand exposes the service as a Symfony Console command.

CLI usage

# Preview candidates without deleting (dry run)
typo3 delete_hidden:cleanup --days=90 --dry-run

# Delete hidden content older than 30 days
typo3 delete_hidden:cleanup --days=30

# Scope to a specific page subtree
typo3 delete_hidden:cleanup --days=90 --page=42

# Override the default safety cap of 500
typo3 delete_hidden:cleanup --days=90 --limit=1000

# Verbose output — shows a table of deleted records
typo3 delete_hidden:cleanup --days=90 -v

Options

Option Default Description
--days 90 Minimum age in days for a record to be a candidate
--dry-run List candidates without performing any deletions
--page 0 (all pages) Restrict to a page subtree by UID
--limit 500 Safety cap — aborts before any deletion when exceeded

Exit codes

Code Meaning
0 Success
1 Validation error, safety cap exceeded, or DataHandler error

Page exclusion

Set tx_delete_hidden_exclude = 1 on a page to exclude all its content from cleanup.

Installation

composer require marketing-factory/delete-hidden

Then activate the extension in the TYPO3 backend under Admin Tools > Extensions or via CLI:

typo3 extension:activate delete_hidden

Scheduler task

The extension registers a TYPO3 Scheduler task named "Delete Hidden Content Elements".

  1. Navigate to System > Scheduler in the TYPO3 backend
  2. Add a new task and select Delete Hidden Content Elements from the class dropdown
  3. Configure the fields:
    • Days — minimum age in days for a record to be a candidate (default: 90)
    • Limit — maximum records per run (default: 500)
  4. Set frequency and save

The Scheduler task always executes (no dry-run mode). If the candidate count exceeds the limit, only the first N records are processed; the rest are handled in subsequent runs.

Running tests

Tests require the project's Composer dependencies to be installed (the vendor/ directory at the repository root).

# From the repository root — run all unit tests for this extension
phpunit -c extensions/delete_hidden/Tests/Build/UnitTests.xml
# From the repository root — run all functional tests for this extension (requires running MySQL database via ddev)
phpunit -c extensions/delete_hidden/Tests/Build/FunctionalTests.xml

Test files are located in Tests/Unit/ and Tests/Functional/.

Requirements

  • TYPO3 13.4+
  • PHP 8.2+
  • b13/container (optional) — required only if the host project uses container elements

统计信息

  • 总下载量: 2.69k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-2.0-or-later
  • 更新时间: 2026-03-25

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固