/ Published in: Python
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
import MySQLdb tblPrefix = 'TABLE_PREFIX' conn = MySQLdb.connect (host='localhost', user='USERNAME', passwd='PASSWORD', db='DATABASE') cursor = conn.cursor() # delete hello world post cursor.execute('delete * from %sposts' % (tblPrefix)) # create a password, wp makes a random default one cursor.execute("""update %susers set user_pass = md5('PASSWORD') where user_login='admin'""" % (tblPrefix)) # title the blog cursor.execute('''update %soptions set option_value='TITLE_OF_BLOG' where option_id=3''' % (tblPrefix)) # make the blog public cursor.execute('''update %soptions set option_value = '1' where option_name = 'blog_public' ''' % (tblPrefix)) # allow pingback cursor.execute("""update %soptions set option_value = '1' where option_name = 'default_pingback_flag'""" % (tblPrefix)) # open for pings cursor.execute("""update %soptions set option_value = 'open' where option_name = 'default_ping_status'""" % (tblPrefix)) # open for comments cursor.execute("""update %soptions set option_value = 'open' where option_name = 'default_comment_status'""" % (tblPrefix)) # disallow comment registration cursor.execute("""update %soptions set option_value = '0' where option_name = 'comment_registration'""" % (tblPrefix)) # non-static page cursor.execute("""update %soptions set option_value = '0' where option_name = 'page_on_front'""" % (tblPrefix)) cursor.close() conn.close()
URL: http://blackcodeseo.com/automatically-installing-wordpress/