1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

HOWTO: Align WordPress and XenForo Admins

Align the IDs and user_id in WP and XF for better integration

  1. LPH
    Compatible WP Versions:
    • 3.8
    • 3.9
    • 4.0
    • 4.1
    • 4.2
    • 4.3
    • 4.4
    • 4.5
    Compatible XF Versions:
    • 1.2
    • 1.3
    • 1.4
    • 1.5
    A common installation stumbling block for people is to not align IDs. Once the XenWord plugin is installed they will try to login with their XenForo user_id and receive a permission denied on the WordPress side.

    Alignment of user accounts is very important. The XenForo account user_id will take over and must match a WordPress ID so that roles and capabilities are set properly.

    Use the following table to help you align the WordPress ID in the users table as well as the WordPress user_id in the usermeta table and XenForo user_id in the XenForo database tables. This should be done for every admin, editor, author, etc.

    In the following example, it's quickly seen that user_id 2 in XenForo is assigned to RWH but ID 2 is LPH in WordPress. If we do not make any changes then RWH will login and have all of the roles and capabilities of LPH. This isn't good. At the same time, Albert's user_id in XenForo is 6, the same ID in WordPress as Gracie. Albert would login and have all of Gracie's roles and capabilities.

    Screen Shot 2015-03-01 at 4.13.22 PM.png

    The fix is to change the IDs on the WordPress side in two tables (users and usermeta tables). Do not make changes to the XenForo side.

    First, find all of the involved IDs and user_ids. There are some subscribers that probably have the 1006 user_id in XenForo as well as user_id 9.

    In the example above, this is a completed chart.
    Screen Shot 2015-03-01 at 4.24.25 PM.png

    Once this information is known then it becomes clear how to move IDs around in WordPress.

    Here are the proposed changes for our example.

    Screen Shot 2015-03-01 at 4.32.50 PM.png

    Backup your database before making any changes.

    Use phpmyadmin to change the ID in the WordPress users table as well as the user_id in the WordPress usermeta table. Change the WordPress information and you are done.

    IMPORTANT: The above diagram shows xf_user_id. This is NOT the user_id in the XenForo database. The xf_user_id was added by older XenWord versions. This is shown because some people already activated XenWord prior to seeing this document.
    Motobaka likes this.