跳到内容

DFX Random User IDs

v20261121

David Marín Carreño (DaveFX) · 2017年5月23日 上架

This WordPress plugin randomizes the user_id for the user created on WordPress setup, removing one potential attack factor from the site.

正在使用
200+
评分
4.0 / 5
累计下载
8,704
最近更新
2026年11月22日
5 条评价需要 WordPress 4.9+已测试到 7.0.9PHP 7.4+

This WordPress plugin randomizes the user_id for the user created on WordPress setup, removing one potential attack factor from the site.

How it works

Once activated, the plugin will immediately replace the ID for the default admin user (with user ID 1). By default, the plugin will use random user IDs between 1 and 4503599627370495 (to ensure compatibility with Javascript code using the user ID).

All newly created users from that moment will be generated with a random user ID in the defined range.

Settings page

Settings Random User IDs (Network Admin Settings on multisite, because users are shared by the whole network) shows:

  • The site’s status: whether a user with ID 1 exists, how many users have IDs below 1,000, and how many have an ID that follows another user’s. These are the IDs an attacker can guess.
  • The range for new user IDs, which you can change there. The range must hold at least ten IDs for every user, so that finding a free random ID stays quick. Existing users keep their IDs.
  • A “More plugins” tab with the author’s other plugins.

How to customize the range for new user IDs

The easiest way is the settings page. You can also customize the range with the WordPress filters dfx_random_user_id_max_id and dfx_random_user_id_min_id, which take precedence over the settings page.

For example, if you want to have all your user IDs between 1000 and 9999 you can add the following lines to your theme’s functions.php file:

function set_dfx_max_user_id( $default_max_id ) {
    return 9999;
}
add_filter( 'dfx_random_user_id_max_id', 'set_dfx_max_user_id' );

function set_dfx_min_user_id( $default_max_id ) {
    return 1000;
}
add_filter( 'dfx_random_user_id_min_id', 'set_dfx_min_user_id' );

Probably, you’ll want to add these lines to your code before activating the plugin, so your new random main admin user ID is inside your desired range.

External services

Author’s plugin catalog (davefx.com)

The “More plugins” tab of the settings page lists the author’s other plugins. When an administrator opens that tab, the plugin downloads the list from https://davefx.com/plugins.json, at most once a week. Nothing about the site or its users is sent: the request identifies itself only as DFX-Plugin-Showcase and its version, although, as with any web request, davefx.com’s server receives the IP address of the server making it. If the file cannot be reached, a copy bundled with the plugin is shown. Nothing else in the plugin connects to any external service.

  • Privacy Policy: https://davefx.com/en/privacy-policy/

Plums

按场景查找 WordPress 插件。安装量、评分和兼容版本来自官方目录。

导航

说明

WordPress 是 WordPress Foundation 的商标。本站与 WordPress Foundation、Automattic 没有隶属关系。这里不托管插件文件,下载和安装以 WordPress.org 上的页面为准。

© 2026 Plums