Getting Started
WordPress plugin
Connect WordPress to DocID®, protect content, and use verified professional attributes in native workflows.
The official DocID® plugin connects WordPress to one of the largest online networks of healthcare professionals. It protects posts, pages, custom post types, and media and can integrate verified professional identities with native WordPress users, roles, menus, and content.
Open the DocID® plugin on WordPress.org
Prerequisites
- A WordPress website using HTTPS and administrator access
- A DocID® account with a configured website asset and OAuth credentials
- A backup and a staging environment for validating site-specific themes, plugins, and access rules
Install the plugin
Using WordPress administration
Open Plugins → Add New → Upload Plugin, select the current DocID® plugin archive, install it, and choose Activate Plugin.
Using WP-CLI
Install and activate a local plugin archive from the WordPress root:
wp plugin install /path/to/docid.zip --activateConfigure OAuth and requested customer data
- Open Settings → DocID® → OAuth credentials.
- Copy the displayed callback URL into the allowed redirect URIs of the corresponding website asset in the DocID® business dashboard.
- Enter the asset Client ID and Client Secret.
- Under Requested customer data, keep openid and professional enabled and activate only the optional profile, email, or phone data the website needs.
Available scopes
| Scope | Status | Claims |
|---|---|---|
| openid | Required | sub |
| professional | Required | profession_id, discipline_id, profession_verified |
| profile | Optional | name, title, given_name, family_name, gender |
| Optional | ||
| phone | Optional | phone_number |
Optional native WordPress accounts
Enable native provisioning only when WordPress roles, capabilities, or integrations require a native current user. New users receive a stable non-personal username and are linked only through the immutable DocID® subject, never automatically by email. Email synchronization is optional and automatically enables the optional email scope. The admin bar can be hidden separately for provisioned DocID® users without affecting other WordPress users. Existing local roles assigned outside DocID® remain unchanged.
Role mappings
Map all DocID® users or exact profession, discipline, institution, or subject identifiers to one or more non-administrative WordPress roles. Matching mappings are combined and can be added, edited, or removed from the role-mapping table.
Content protection
Use the DocID® login panel on supported edit screens to protect posts, pages, custom post types, or media. The Content protection tab provides a searchable, post-type-filtered, paginated overview with direct edit links.
Login destinations
Configure local profession- or discipline-based destinations. Lower priority numbers win when several mappings match. Content requested before authentication always takes precedence over a profile-based destination.
Available shortcodes
Add Account navigation to a WordPress menu or use the shortcodes below in content, widgets, and compatible page-builder fields.
The login link is state-aware: it shows sign in to visitors and logout to authenticated DocID® users. Its login_text and logout_text attributes customize both labels. The username tag uses the best available value in this order: title, first name and last name; title and last name; authorized email address; stable DocID® user ID.
| Shortcode | Description |
|---|---|
| [docid-account-navigation] | Shows Sign in to visitors. For authenticated DocID® users, it shows the best available username followed by | Log out. |
| [docid-loggedin-content]Content[/docid-loggedin-content] | Shows the enclosed content only to authenticated DocID® users. |
| [docid-loggedout-content]Content[/docid-loggedout-content] | Shows the enclosed content only to visitors without an authenticated DocID® session. |
| [docid-login-link] | Shows Sign in to visitors and Log out to authenticated DocID® users. |
| [docid-login-link login_text="Access" logout_text="Leave"] | Uses custom plain-text labels for both authentication states. |
| [docid-username] | Shows the best available username: title, first name, and last name; then title and last name; then the authorized email address; and finally the stable DocID® user ID. |
Profile data
| Shortcode | Scope | Description |
|---|---|---|
| [docid-profile-id] | openid (required) | The stable, unique DocID® account identifier. |
| [docid-profile-name] | profile (optional; authorization required) | The combined title, given name, and family name. |
| [docid-profile-title] | profile (optional; authorization required) | The title or form of address. |
| [docid-profile-given-name] | profile (optional; authorization required) | The given name. |
| [docid-profile-family-name] | profile (optional; authorization required) | The family name. |
| [docid-profile-gender] | profile (optional; authorization required) | The gender value. |
| [docid-profile-email] | email (optional; authorization required) | The transferred email address when available. |
| [docid-profile-phone-number] | phone (optional; authorization required) | The transferred phone number when available. |
Access authentication status and claims in PHP
The public base API can read the current DocID® session without requiring native WordPress provisioning. Optional values are present only when their scope was requested, authorized, and returned.
$docid = new \DOCID\Includes\DOCID_Base();$is_docid_authenticated = $docid->docid_is_loggedin();$identity = $docid->docid_get_user(); $docid_subject = is_array($identity) ? ($identity['id'] ?? NULL) : NULL;$profession_id = is_array($identity) ? ($identity['profession_id'] ?? NULL) : NULL;$discipline_id = is_array($identity) ? ($identity['discipline_id'] ?? NULL) : NULL;$institution_id = is_array($identity) ? ($identity['institution_id'] ?? NULL) : NULL;$subject_id = is_array($identity) ? ($identity['subject_id'] ?? NULL) : NULL;$profession_verified = is_array($identity) ? (bool) ($identity['profession_verified'] ?? FALSE) : FALSE; // Optional values exist only when their scope was authorized.$name = is_array($identity) ? ($identity['name'] ?? NULL) : NULL;$email = is_array($identity) ? ($identity['email'] ?? NULL) : NULL;$phone = is_array($identity) ? ($identity['phone'] ?? NULL) : NULL;$wordpress_user_id = is_array($identity) ? ($identity['wordpress_user_id'] ?? NULL) : NULL;Test before launch
- Open public and protected content while signed out.
- Complete sign-in with an eligible test account and verify the return to the originally requested content.
- Continue without optional profile data and confirm that authentication still works with the required scopes.
- Test every configured role mapping and login destination, including a non-matching account.
- Sign out and confirm that protected content is no longer accessible.
The integration supplies technical authentication and access-control features. Website operators remain responsible for choosing appropriate scopes, permissions, notices, and legal bases for their implementation.