batch change article author?

Need help with the Administration of your Joomla! 2.5 site? This is the spot for you.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Locked
cbrace
Joomla! Apprentice
Joomla! Apprentice
Posts: 38
Joined: Wed May 05, 2010 10:04 pm
Location: Amsterdam
Contact:

batch change article author?

Post by cbrace » Sat Jun 30, 2012 10:48 pm

Hi all,

Can someone suggest a way to change the attribution of around 150 articles? A MySQL query perhaps?

Thanks

User avatar
imanickam
Joomla! Master
Joomla! Master
Posts: 27227
Joined: Wed Aug 13, 2008 2:57 am
Location: Chennai, India

Re: batch change article author?

Post by imanickam » Sun Jul 01, 2012 7:29 am

Yes, definitely SQL would be of help.

If you know the individual articles ids, the articles ids range, or even for all the articles, you could use SQL.

First, note down the id of the user from the User Manager or from the table jos_users where jos_ is the table prefi.

For all the articles, the SQL would be:

Code: Select all

UPDATE jos_content SET created_by = ##;
where jos_ is the table prefix and ## is the id of the user

For the articles that are within a range, the SQL would be:

Code: Select all

UPDATE jos_content SET created_by = ## WHERE id BETWEEN xx AND yy;
where jos_ is the table prefix, ## is the id of the user, xx is the starting article id of the range and yy is the ending article id of the range

For the articles that are discrete, the SQL would be:

Code: Select all

UPDATE jos_content SET created_by = ## WHERE id IN (id1, id2, id3);
where jos_ is the table prefix, ## is the id of the user and id1, id2, id3 are article ids

Note: Make a back-up of the database content before attempting this
Ilagnayeru (MIG) Manickam | இளஞாயிறு மாணிக்கம்
Joomla! - Global Moderators Team | Translations Coordination Team | Tamil (தமிழ்) Translation Team

Eegan - Support the poor and underprivileged

cbrace
Joomla! Apprentice
Joomla! Apprentice
Posts: 38
Joined: Wed May 05, 2010 10:04 pm
Location: Amsterdam
Contact:

Re: batch change article author?

Post by cbrace » Sun Jul 01, 2012 11:22 am

Hi, very helpful.

One question: would it be possible to formulate a query in which all articles in jos_content written by user ID 42 are changed to 72?

User avatar
imanickam
Joomla! Master
Joomla! Master
Posts: 27227
Joined: Wed Aug 13, 2008 2:57 am
Location: Chennai, India

Re: batch change article author?

Post by imanickam » Sun Jul 01, 2012 11:50 am

Yes, of course... Try the following:

Code: Select all

UPDATE jos_content SET created_by = ## WHERE created_by = 42;
where jos_ is the table prefix and ## is the user id of the new author
Ilagnayeru (MIG) Manickam | இளஞாயிறு மாணிக்கம்
Joomla! - Global Moderators Team | Translations Coordination Team | Tamil (தமிழ்) Translation Team

Eegan - Support the poor and underprivileged

cbrace
Joomla! Apprentice
Joomla! Apprentice
Posts: 38
Joined: Wed May 05, 2010 10:04 pm
Location: Amsterdam
Contact:

Re: batch change article author?

Post by cbrace » Sun Jul 01, 2012 12:47 pm

Worked perfectly. BIG thanks.

SkywalkerAB
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Sun Apr 22, 2012 8:52 am

Re: batch change article author?

Post by SkywalkerAB » Sat Nov 02, 2013 1:54 pm

Hi,

It would be great if you could help me with the same, only than batch change by category. Thanks!

jdran
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 184
Joined: Thu Aug 16, 2012 5:32 pm

Re: batch change article author?

Post by jdran » Thu Jan 09, 2014 4:46 pm

Thanks!

So what I did was to open the phpMyAdmin and click the tab SQL and clear anything written into the box (such as

Code: Select all

SELECT * FROM `jos_content` WHERE 1
) and insert my code:

Code: Select all

UPDATE jos_content SET created_by = 103 WHERE created_by = 100;
and press GO.
That did the trick!

I'd be also interested for what SkyWalker asks too.

okanime
Joomla! Apprentice
Joomla! Apprentice
Posts: 18
Joined: Sat Nov 03, 2007 6:40 pm
Contact:

Re: batch change article author?

Post by okanime » Tue May 06, 2014 5:25 pm

Will this work for Joomla 3.3.X?

okanime
Joomla! Apprentice
Joomla! Apprentice
Posts: 18
Joined: Sat Nov 03, 2007 6:40 pm
Contact:

Re: batch change article author?

Post by okanime » Tue May 06, 2014 5:39 pm

okanime wrote:Will this work for Joomla 3.3.X?
I will like to answer my own question and confirm that it works for Joomla 3.3.x

User avatar
jjspelman
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 220
Joined: Tue Apr 07, 2009 6:27 am
Location: Tampa, FL
Contact:

Re: batch change article author?

Post by jjspelman » Thu Oct 16, 2014 1:27 pm

imanickam wrote:Yes, of course... Try the following:

Code: Select all

UPDATE jos_content SET created_by = ## WHERE created_by = 42;
where jos_ is the table prefix and ## is the user id of the new author

Beautiful!!! Thank you!

Bzz
Joomla! Apprentice
Joomla! Apprentice
Posts: 22
Joined: Tue Mar 24, 2009 11:17 am

Re: batch change article author?

Post by Bzz » Mon Feb 15, 2016 8:18 pm

What if i want to batch change it for all articles in one specific category?

User avatar
formfranska
Joomla! Intern
Joomla! Intern
Posts: 93
Joined: Sun Dec 28, 2008 3:25 pm
Location: Sweden
Contact:

Re: batch change article author?

Post by formfranska » Mon Feb 13, 2017 4:21 pm

Awesom help! Thank you imanickam
Joomler in Sweden :-)
https://www.formfranska.com


Locked

Return to “Administration Joomla! 2.5”