RTFM.WIKI

Ordnung muß sein. Ordnung über alles (18+)

Инструменты пользователя

Инструменты сайта


Боковая панель


Навигация

Линкшэринг

ALARM!

Добавить новую страницу

You are not allowed to add pages
web:wordpress_sql_url


CMS: Wordpress - SQL команды

Пароль пользователя

> UPDATE wp_users SET user_pass = MD5(‘VeryStr0ngPSWD’) WHERE user_login='username’ LIMIT 1;

Почта администратора

> UPDATE wp_options SET option_value = REPLACE(option_value, 'old-email@foobar.com', 'vova@kermlin.ru') WHERE option_name = 'admin_email';

Адрес сайта

Изменить адрес сайта с oldurl.com на newulr.com

> SELECT * FROM wp_options WHERE option_name = 'home' OR option_name = 'siteurl';
> UPDATE wp_options  SET option_value = REPLACE(option_value, 'http://oldurl.com', 'https://newurl.com') WHERE option_name = 'home' OR option_name = 'siteurl';

Ссылки в постах

> UPDATE wp_posts    SET guid = REPLACE(guid, 'http://oldurl.com','https://newurl.com');
> UPDATE wp_posts    SET post_content = REPLACE(post_content, 'http://oldurl.com', 'https://newurl.com');
> UPDATE wp_postmeta SET meta_value = REPLACE(meta_value,'http://oldurl.com','https://newurl.com');

Meta, комментарии, ссылки

> UPDATE wp_usermeta SET meta_value = REPLACE(meta_value, 'http://oldurl.com','https://newurl.com');
> UPDATE wp_comments SET comment_content = REPLACE(comment_content , 'http://oldurl.com','https://newurl.com');
> UPDATE wp_links    SET link_url = REPLACE(link_url, 'http://oldurl.com','https://newurl.com');

Изображдения

> UPDATE wp_posts SET post_content = REPLACE(post_content, 'http://oldurl.com', 'https://newurl.com');
> UPDATE wp_links SET link_image = REPLACE(link_image, 'http://oldurl.com','https://newurl.com');
> UPDATE wp_posts SET guid = REPLACE(guid, 'http://oldurl.com','https://newurl.com');

Добавить администратора

INSERT INTO `wp_users` (`user_login`, `user_pass`, `user_nicename`, `user_email`, 
`user_status`)
 VALUES ('new-admin-name', MD5('new-admin-password'), 'firstname lastname', 'new-admin@email', '0');
 
 INSERT INTO `wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`) 
 VALUES (NULL, (SELECT MAX(id) FROM wp_users), 
 'wp_capabilities', 'a:1:{s:13:"administrator";s:1:"1";}');
 
 INSERT INTO `wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`) 
 VALUES (NULL, (SELECT MAX(id) FROM wp_users), 'wp_user_level', '10');
This website uses cookies. By using the website, you agree with storing cookies on your computer. Also you acknowledge that you have read and understand our Privacy Policy. If you do not agree leave the website.More information about cookies

Discussion

Enter your comment. Wiki syntax is allowed:
 
web/wordpress_sql_url.txt · Последнее изменение: 2020/04/29 05:24 — dx