Re: WordPress + bbPress Integration 101
== Instant Integration for Power Users ==
If you’ve just installed bbPress 0.9 into a WordPress 2.5 website and followed the integration setup questions but it’s just not integrating correctly and you feel you are fairly web savvy you can try this “shortcut”. (Or read the other posts below for more “theory”.)
** If you have lost admin access entirely, do steps #4+ first and then come back to 1,2,3
1. open this url in a browser window to edit:
http://your-website-url.com/bbpress/bb-admin/options-wordpress.php
(/bbpress/ is your install directory for bbpress)
2. open this url in another browser window for reference:
http://your-website-url.com/wordpress/wp-admin/options.php
(/wordpress/ is your install directory for wordpress)
3. you MUST copy the secret text
from /wordpress/wp-admin/options.php
to WordPress database secret
on /bbpress/bb-admin/options-wordpress.php
They *MUST* be IDENTICAL
4. open to Edit bb-config.php
in the bbPress directory
5. open to Edit wp-config.php
in the WordPress directory
6. bbPress 0.9
the define("SECRET_KEY","blahblahblah")
in
your WordPress wp-config.php
MUST MATCH the
define("BB_SECRET_KEY","blahblahblah")
in
your bbPress bb-config.php
bbPress 1.0
instead of SECRET_KEY in 1.0 there are 3 replacements
AUTH_KEY
SECURE_AUTH_KEY
LOGGED_IN_KEY
you can go here to generate a complex secret_key(s):
bbPress 0.9: https://api.wordpress.org/secret-key/1.0/
bbPress 1.0: https://api.wordpress.org/secret-key/1.1/
(note you must add the BB_ part for the bb-config.php)
7. Copy all these items into the bottom of bb-config.php and edit as required:
$bb->wp_siteurl = 'http://your-site-url.com/blog/';
// that’s your WordPress URL, not bbPress
$bb->wp_home = 'http://your-site-url.com/blog/';
// almost always the same as siteurl unless you tinker
$bb->wp_table_prefix = 'wp_';
// should almost always be wp_ unless you tinkered
$bb->user_bbdb_name = 'username_wordpress';
// this is the MYSQL database name for *WordPress*
// you can copy it right out of WordPress !
$bb->user_bbdb_user = 'username_wp';
// this is the MYSQL user name for *WordPress*
// you can copy it right out of WordPress !
$bb->user_bbdb_password = 'blahblahblah-changeme';
// this is the MYSQL password for *WordPress*
// you can copy it right out of WordPress !
$bb->user_bbdb_host = 'localhost';
// 99.9% of the time it’s going to be localhost, unless you are on DreamHost or some other weird ISP
$bb->custom_user_table = 'wp_users';
// 99.9% of the time it’s going to be wp_users
$bb->custom_user_meta_table = 'wp_usermeta';
// 99.9% of the time it’s going to be wp_usermeta
$bb->authcookie = 'wordpress_12345678901234567890123456789012';
// in theory you should be able to leave this out
// but this is going to be copied from WordPress cookie
// this *must* match the WordPress setting
// do NOT use the 1234567 part, use your own cookiehash from WordPress – see the note at the very bottom
$bb->cookiedomain = '.your-domain-name.com';
// note the leading DOT – this is important
// this *must* match the WordPress setting
$bb->cookiepath = '/';
// I *highly* recommend you set the cookie path to /
// this *must* match the WordPress setting
$bb->sitecookiepath = '/';
// I *highly* recommend you set the cookie path to /
// this *must* match the WordPress setting
8. Copy all these items into the bottom of wp-config.php and edit as required:
$wp->cookiedomain = '.your-domain-name.com';
define(COOKIE_DOMAIN,'.your-domain-name.com');
// note the leading DOT – this is important
// we list both for WordPress legacy compatibility
$wp->cookiepath = '/';
$wp->sitecookiepath = '/';
define('COOKIEPATH', '/' );
define('SITECOOKIEPATH', '/');
// I *highly* recommend you set the cookie path to /
Once you get all of the above in sync, you definitely should have login integration between WordPress and bbPress. If not, you’ve either made a typo/mistake or you have a more complex setup (ie. reverse integration)
The hardest part of the above might be the wordpress cookie hash (authcookie). In theory you should be able to leave it out and bbPress should automatically create the same hash as WordPress if the secret keys and salt are the same but sometimes it gets it wrong for one reason or another and you have to force it to be correct.
Unfortunately WordPress does not list the cookie hash on the options page and if you don’t know how to examine your wordpress cookies, this is impossible. Fortunately there is a plugin to look at (and even change) your wordpress cookies:
http://www.2diabolos.com/blog/wp-content/uploads/_setCookieParams.zip
or you can use this bookmarklet to show all the cookies your browser has for a website: