=== Adminkeep – Email Log, Custom CSS, Disable Comments, Site Lockdown & Admin Enhancements === Contributors: sajib1223 Tags: disable comments, lockdown, email log, custom css, enhancements Requires at least: 6.9 Tested up to: 7.1 Requires PHP: 7.4 Stable tag: 2.2.0 License: GPLv2 or later License URI: https://www.gnu.org/licenses/gpl-2.0.html Email log, custom CSS, disable comments, site lockdown and more admin enhancements. Every feature is off until you switch it on. == Description == You decide what changes on this site. Adminkeep is a set of tools under that one idea. **Site Lock** stops things changing behind your back — no new comment, no new plugin, no new user. **Content** makes the changes you do want safe to make. Every feature is a single switch, off until you turn it on. **Switching one off never leaves you repair work**: the locks work purely through WordPress filters, so your site is exactly as it was, and what you made with the Content features stays where you put it. = Site Lock = * **Disable Comments** — comments off everywhere, including direct POSTs from spam bots and the REST API. Nothing is written to your database, so switching it off brings every comment back. An optional cleanup button deletes spam and trashed comments, after showing you the exact count. [Guide](https://adminkeep.com/guides/disable-comments-wordpress/) * **Registration Lockdown** — stops new accounts being created, and refuses creation of or promotion to administrator. Blocked attempts are logged. [Guide](https://adminkeep.com/guides/stop-spam-user-registration-wordpress/) * **Disable XML-RPC** — closes `xmlrpc.php` completely, including pingbacks and `system.multicall`. [Guide](https://adminkeep.com/guides/disable-xmlrpc-wordpress/) * **Disable File Editing** — removes the built-in plugin and theme file editors, reversibly. * **Installation Lockdown** — no new plugins or themes, from WordPress.org or a ZIP, and no replacing one by uploading a ZIP, for anyone. Updates keep working, so security releases still reach your site. [Guide](https://adminkeep.com/guides/block-plugin-installs-wordpress/) * **Username Privacy** — keeps your usernames out of public view. Author pages, the `?author=1` probe, the REST users list, author sitemaps and embed previews stop naming your accounts to visitors; anyone logged in sees everything as before. Nothing is written, so switching it off reopens it all. [Guide](https://adminkeep.com/guides/hide-wordpress-username/) = Appearance = * **Custom CSS** — CSS that belongs to your site instead of your theme. Edit it under Appearance with WordPress's own code editor, or open Edit CSS from the admin bar on any page and watch the page restyle as you type, the way the Customizer's CSS box used to. It stays when you switch themes, and your theme's Additional CSS is left alone. * **Header & Footer Code** — a home for the snippets services ask you to paste into your site: analytics and verification tags in the head, a tag manager's fallback just after the body opens, chat widgets and scripts in the footer. Three boxes under Appearance with WordPress's code editor, printed on the front end exactly as you saved them, and kept when you change or update your theme. Each box shows who last changed it and when. Only administrators allowed to post unfiltered HTML can edit them. = Email = * **SMTP** — Send your site's email through an SMTP server so password resets and form messages arrive. Presets for Amazon SES, Brevo, Mailgun, SendGrid, Postmark, Zoho and Gmail; a test email that shows the server's own error; settings can live in wp-config.php. Moving from WP Mail SMTP? One click copies its SMTP connection settings. [Guide](https://adminkeep.com/guides/wordpress-smtp-settings/) * **Email Log** — Email Log, in its own item in the admin menu by default (or under Tools, if you prefer), lists the email your site sends, with recipient, subject and whether it was sent or failed, plus filters by status and date and a search. Open any email to see its sender and headers, and the email itself the way it looked when it went out, with remote images blocked. Content storage can be switched off to keep only the envelope. Password-reset and sign-in links are removed before an email is stored. Works with or without the SMTP feature, and with other SMTP plugins too. * **Nice Default Emails** — WordPress's own plain-text emails (password resets, new-user and comment notices, update reports, personal data requests, and multisite sign-ups) go out in one clean HTML layout headed by your site's name, with links you can click. WooCommerce and other plugins' emails, and anything already sent as HTML, are left exactly as they are. No settings. `wp adminkeep emails send --all --to=you@example.com` shows every one of them in your own inbox. = Admin = * **User Registration Date** — a sortable Registered column on the Users screen. WordPress records when every account was created but never shows it; this does, for every existing user, and newest-first sorting makes a wave of spam signups easy to spot. [Guide](https://adminkeep.com/guides/wordpress-user-registration-date/) = Content = * **Duplicate** — copy any post or page as a draft. Custom fields, taxonomies, the featured image and page builder layouts (Elementor, ACF) come along intact, and the original is never modified. [Guide](https://adminkeep.com/guides/duplicate-page-wordpress/) * **Live Draft** — rework a published page in a private working copy, then publish it over the original. Same ID, same URL, and the old version is kept as a revision. [Guide](https://adminkeep.com/guides/edit-published-page-without-unpublishing/) * **Keep URL** — rename or move a page and its old address keeps working, child pages included. Fills the gaps WordPress leaves for pages and leaves posts to core. [Guide](https://adminkeep.com/guides/change-wordpress-slug-redirect/) * **Order** — drag posts into the order you want on a dedicated Sort screen, one post type at a time. Lists that already ask for their own order, such as WooCommerce products and search results, are left alone. [Guide](https://adminkeep.com/guides/reorder-wordpress-posts/) * **Replace Media** — upload a new version of a file over the old one. Same file type keeps the same URL; a different type updates the posts that use it and redirects the old address. [Guide](https://adminkeep.com/guides/replace-image-wordpress-same-url/) = Performance = A feature you have not enabled registers zero hooks and loads zero assets. = Links = * [Website](https://adminkeep.com/) * [Documentation](https://adminkeep.com/docs/) * [Guides](https://adminkeep.com/guides/) == Installation == 1. In your WordPress admin, go to **Plugins → Add New Plugin**, search for "Adminkeep" and click **Install Now**, then **Activate**. 2. Open **Settings → Adminkeep**, or the **Settings** link under Adminkeep on the Plugins screen. Every feature starts **off**; switch on only the ones you want. 3. To remove the plugin, deactivate and delete it as usual. Its settings and data are kept, so installing it again brings them back; to remove them as well, switch on **Delete all Adminkeep data when the plugin is deleted** under **Settings → Adminkeep → Plugin settings** before deleting. Nothing it changed while enabled outlives switching the feature off. Or with WP-CLI: `wp plugin install adminkeep --activate` == WP-CLI == Everything on the Adminkeep settings screen, plus the Custom CSS, Header & Footer Code and SMTP screens, can be done from a shell with `wp adminkeep`. `wp adminkeep feature list` — every feature and whether it is on `wp adminkeep feature enable disable_comments` — switch a feature on (or `disable` it) `wp adminkeep feature set order post_types=post,page` — change a feature's settings `wp adminkeep setting set hide_unused=true` — change a plugin-level setting `wp adminkeep comments purge` — delete spam and trashed comments, in batches `wp adminkeep css set site.css` — replace the Custom CSS from a file `wp adminkeep code set head analytics.html` — replace one Header & Footer Code box (head, body or footer) from a file `wp adminkeep smtp set --host=smtp.example.com --port=587` — configure SMTP `wp adminkeep smtp test you@example.com` — send a test email and see the server's reply `wp adminkeep emails send --all --to=you@example.com` — see WordPress's own emails in the Nice Default Emails layout `wp adminkeep smtp import wp-mail-smtp` — copy the SMTP connection settings from WP Mail SMTP Run `wp help adminkeep` for the full reference. A change made here is cleaned and checked exactly as it is on the screen, and a mistyped value is refused rather than guessed at. == Frequently Asked Questions == = Will this delete my comments? = Not unless you ask it to. Turning Disable Comments on only hides them — a test asserts the comment rows are untouched after a full enable-and-disable cycle. There is a separate cleanup button that does delete, and it deletes **spam and trashed comments only** unless you tick the box to include approved ones. It shows the exact count, asks you to confirm, and cannot be undone. = Can I turn it back off? = Yes, instantly. There is never a migration to run or a repair step to find. The locks work purely through WordPress filters, so nothing was written to your database to undo — switch one off and your site is exactly as it was. The Content features are deliberately different: they write the things you asked them to write. A copy you made, an order you saved, a file you replaced, a redirect recorded when you renamed a page — switching the feature off stops it doing any more, and leaves what it already did alone. Work you did on purpose should not disappear because you unticked a checkbox. = Does this actually stop comment spam bots? = Yes. Bots usually POST straight to `wp-comments-post.php` without ever loading your page, so hiding the comment form does nothing. Adminkeep refuses those requests with a 403 before WordPress processes them, and refuses comment creation through the REST API as well. = Is Installation Lockdown a security feature? = Not exactly, and it would be dishonest to say otherwise. It is enforced in PHP, so anyone with filesystem, database or WP-CLI access can bypass it. It reliably stops accidents and casual changes — a client uploading a plugin zip from who knows where, or overwriting an installed plugin with one. Treat it as a policy guard, not a security boundary. = Why not just use the DISALLOW_FILE_MODS constant? = Because it cannot be switched off from the admin. Once it is in `wp-config.php` you need file access to undo it, which strands people. Installation Lockdown filters capabilities instead, so you can always turn it off from the settings screen. If you want the harder version, the constant is still there and this plugin does not interfere with it. = Does the SMTP feature work with Gmail or Microsoft 365? = Gmail and Google Workspace: yes, with an app password. Microsoft 365 and Outlook.com: no — Microsoft now requires signing in through Microsoft (OAuth) for SMTP, which this feature does not support. A dedicated SMTP plugin is the better choice there. = Where is my SMTP password kept? = Encrypted in your site's database, which protects it in database backups. For the strongest setup define ADMINKEEP_SMTP_PASS (and the other ADMINKEEP_SMTP_* constants) in wp-config.php: values set there are not saved to the database, and the settings form does not display them. = Does the email log store password-reset links? = They are removed before an email is stored, along with sign-in and account-activation links. The common link formats are covered, not every possible one, so treat it as a safeguard rather than a guarantee. If you would rather not store email content at all, Email Log has a setting to keep only the envelope — sender, recipient, subject and status — and switch content storage off. = What happens to the email log if I switch the feature off? = Switching it off stops logging. What is already logged stays until you delete it, or delete the plugin with "Delete all Adminkeep data when the plugin is deleted" switched on. While it is off nothing new is recorded and the entries are not aged out, so if you want the log emptied, empty it first — from the Email Log screen, or with `wp adminkeep email-log purge --all` — and then switch the feature off. = What happens to my settings and data when I delete Adminkeep? = They stay, unless you ask otherwise. Deleting the plugin keeps its settings, your Custom CSS and Header & Footer Code, the SMTP settings, the email log and the Keep URL redirects, so installing it again brings everything back. To remove all of it when the plugin is deleted, switch on "Delete all Adminkeep data when the plugin is deleted" under Settings → Adminkeep → Plugin settings, or run `wp adminkeep setting set delete_data=true`. Deactivating never deletes anything. = Where does Header & Footer Code print? = On the front end of your site, on every page. The Head box goes inside `
`, before your theme's own styles and scripts. The Body open box goes just after `` opens, on themes that support it (current themes do). The Footer box goes at the end of the page, after WordPress's own footer scripts. None of it is added to the admin, the login page, feeds or the REST API. Each box holds up to 64 KB. A snippet from an analytics or chat service is a few kilobytes; for anything larger, upload the script as a file and load it with ``. The code is printed exactly as you saved it, so check a snippet on a test page if you are unsure of it. Switching the feature off stops it printing and keeps the code. = Can I manage Adminkeep with WP-CLI? = Yes, since 1.5.0. `wp adminkeep feature list` shows every feature, and `wp help adminkeep` lists the commands for switching features, changing their settings, cleaning up comments, replacing the Custom CSS or the Header & Footer Code, configuring SMTP and choosing whether the settings screen hides unused features for a user. If Installation Lockdown has locked you out of the admin, `wp adminkeep feature disable install_lock` is the way back in. == Screenshots == 1. Five groups, seventeen features, one switch each. Turn on only what you need. 2. Nothing is deleted until you have seen the exact count. Order notes and reviews are excluded unless you say otherwise. 3. The administrator guard is on by default. Blocking plugin-created accounts is opt-in, because it breaks WooCommerce checkout. 4. Stop plugin and theme installs and uploads, while updates keep working — and switch it back off from this same screen. 5. Custom CSS lives under Appearance, in WordPress's own code editor, and stays when you switch themes. 6. Edit CSS from the admin bar on any page of your site: the page restyles as you type, and nothing is saved until you press Save. 7. Header & Footer Code under Appearance: one box each for the head, the top of the body and the footer, and who last changed each one. 8. SMTP under Settings: pick a provider, save, and send a test email that shows what the server said. 9. Email Log in its own admin menu: every email your site sends, whether it went out, and filters for status, period and search. 10. Open any logged email as it was sent, with its source a tab away. Scripts and remote images are blocked in the preview. 11. Duplicate and Live Draft where you already work — the row actions, not a new menu. 12. Rewrite a published page while it stays published. Merge back into the same post, same URL. 13. The redirects WordPress core skips: hierarchical pages, and posts moved to a new parent. 14. Sorting gets a screen of its own: drag a row where you want it — and the order applies to your front-end queries too. 15. Swapping a file for a different format tells you what references it first, then keeps the old URL redirecting. == Changelog == = 2.2.0 = * Changed: deleting Adminkeep now keeps its settings and data, so installing it again brings them back. To remove everything when the plugin is deleted, switch on "Delete all Adminkeep data when the plugin is deleted" in the new Plugin settings tab under Settings → Adminkeep, or run `wp adminkeep setting set delete_data=true`. * New: Header & Footer Code can be read and saved over the REST API at `adminkeep/v1/header-footer-code`, so a site reached with an application password can have it updated. Boxes left out of a save are kept. The same permissions and checks apply as on the Header & Footer Code screen. * Improved: Custom CSS and Header & Footer Code save without reloading the page. * Fixed: deleting the plugin now also clears the scheduled Live Draft clean-up, and deleting it with its data also removes the marker Live Draft leaves on a merged copy. = 2.1.0 = * New: edit Custom CSS on your live site. Edit CSS in the admin bar opens a code panel beside the page, and the page restyles as you type, the way the Customizer's CSS box did. Nothing is saved until you press Save. The panel stays open while you browse to other pages, until you close it. Appearance → Custom CSS opens it too, from its Live preview box. * New: a Custom CSS setting, "Show Edit CSS in the admin bar", on by default. Untick it to hide the admin bar item; the panel still opens from Appearance → Custom CSS. * New: Custom CSS can be read and saved over the REST API at `adminkeep/v1/custom-css`, so a site reached with an application password can have its CSS updated without logging in to wp-admin. The same permissions and checks apply as on the Custom CSS screen. * Changed: the settings now list the feature groups as Site Lock, Appearance, Email, Admin and Content. = 2.0.0 = * New: Header & Footer Code, in Appearance. Three boxes (Head, Body open and Footer) for analytics and verification tags, tag managers and chat widgets, printed on the front end of every page exactly as saved. Each box shows who last changed it and when, and holds up to 64 KB. Only administrators who are allowed to post unfiltered HTML can open it. * New WP-CLI commands: `wp adminkeep code get ` prints one box, and `wp adminkeep code set [