Support Forum

Oops. Changed the default Admin user number

DA Dave
Dave
Member

OK, several months back there were a rash of WordPress site compromises. I run a pretty tight setup, but the one thing I had never changed is the default Admin id (was 1 – is now 491). Well, I made that change using Better WordPress Security and at the same time I updated my actual name to be in compliance with Google Authorship standards.

I never put two and two together, but I’ve had admin difficulties for the past few months and it finally clicked that the problems are associated with the id change. The problems included approvals and such not sticking.

Tonight I also noticed that all my previous posts are now assigned to “guest” even though the username is still a forum admin.

What I didn’t realize is that SimplePress actually created a new user when the id was changed that didn’t have admin privileges, even though the admin bar appeared when I was logged in – this is the reason my approvals and such didn’t “stick”.

So, I’ve added the “new” user to the admins group and everything seems to be working except my previous posts are still associated with user id 1 and listed as guest.

Anyway other than sql to correct those so they are attributed to me? If not, anyone know the sql statement I would need to run against sfpost to make the change?

I also have users still appearing as moderators in the forum stats who I removed after my id change. They do not, however, show as moderators in the admin panel.

10 Answers

New Answer

YS Yellow Swordfish
Yellow Swordfish
Member

I am trying to work out whether just making the change to the user_id in the sfposts table will be more or less enough but I would go for it. We can probably sort any leftovers if there are any…!

So the SQL for that would be:

UPDATE wp_sfposts SET user_id=491 WHERE user_id=1;

Although you may need to change the table prefix (hope so!) and double check that the ID 491 is correct.

After you run that SQL I would suggest you go to the forum admin > Toolbox > Housekeeping and run the user post count cleanup option.

If your forum stats are showing old data then this could mean that your WordPress CRON scheduler has stopped functioning. This is not uncommon. To re-start the scheduler – try deactivating Simple:Press and then immediately reactivating it. Note – deactivate. Do NOT use uninstall!

As always before you run that SQL I would make a full site database backup just in case you need to restore back. Always best to be safe!

 

DA Dave
Dave
Member

Thanks YS. DB updated. Plugin de-activated/re-activated, but users still appear in forum stats as moderators.
Also, do you mean Clean New Posts List? That is the only mention of posts in tools>housekeeping.

YS Yellow Swordfish
Yellow Swordfish
Member

Ah – sorry. Probably the post count tool is a part of the upcoming 5.3 development. because of WordPress 3.6 now being over 2 months late some of these things seem to have been sitting in my test forums for a very ling time! WHEN you update to 5.3 then run that tool! It will correct your post count.

OK – so when you go to the forum admin > Manage user Groups and look at any user groups where you have the moderator flag turned on – are these users listed?

DA Dave
Dave
Member

Yellow Swordfish said
Ah – sorry. Probably the post count tool is a part of the upcoming 5.3 development. because of WordPress 3.6 now being over 2 months late some of these things seem to have been sitting in my test forums for a very ling time! WHEN you update to 5.3 then run that tool! It will correct your post count.

No problem, we all have those moments. :)

OK – so when you go to the forum admin > Manage user Groups and look at any user groups where you have the moderator flag turned on – are these users listed?

Nope.

DA Dave
Dave
Member

Also, when looking at the forum stats it still shows the “old” username as an admin and clicking that to view the profile brings up the “guest” profile.

MP Mr Papa
Mr Papa
Member

the stats are cached… they should clear out after an hour or so…

you can go to forum – toolbox – cron inspector and manually for the ‘sph_stats_cron’ to run to update…

let us know if that resolves it…

DA Dave
Dave
Member

The stats didn’t update after 12 hours, nor did they update after running the cron.

YS Yellow Swordfish
Yellow Swordfish
Member

So let’s just recap…
Are ALL of your stats incorrect and are NONE being updated?

DA Dave
Dave
Member

Some are and some are not.

Guests, currently online, newest members – yes
Moderators and Admins – no

YS Yellow Swordfish
Yellow Swordfish
Member

Strange…

Both the current Admins and Moderators list are populated in the same way. In both cases the sfmembers table is checked. Admins are gathered from those that have a 1 in the ‘admin’ column and likewise moderators who have a 1 in the moderator column.

Can you check your data for these flags?