{"id":2717,"date":"2016-02-03T07:45:58","date_gmt":"2016-02-03T07:45:58","guid":{"rendered":"http:\/\/musilda.cz\/?p=2717"},"modified":"2016-02-03T07:45:58","modified_gmt":"2016-02-03T07:45:58","slug":"odstraneni-revizi-clanku-z-databaze","status":"publish","type":"post","link":"https:\/\/affinite.io\/cs\/odstraneni-revizi-clanku-z-databaze\/","title":{"rendered":"Odstran\u011bn\u00ed reviz\u00ed \u010dl\u00e1nk\u016f z datab\u00e1ze"},"content":{"rendered":"\n

Aktualizov\u00e1no 21.03.2024<\/em><\/p>\n\n\n\n

Ka\u017ed\u00fd rozpracovan\u00fd \u010dl\u00e1nek, ukl\u00e1d\u00e1 WordPress v pr\u016fb\u011bhu pr\u00e1ce, jako revizi. D\u00edky t\u00e9to super vlastnosti, se m\u016f\u017eete vr\u00e1tit v p\u0159\u00edpad\u011b, \u017ee ud\u011bl\u00e1te chybu. U rozs\u00e1hlej\u0161\u00edch web\u016f, mohou takov\u00e9 nepot\u0159ebn\u00e9 revize, zab\u00edrat zna\u010dn\u00e9 mno\u017estv\u00ed prostoru v datab\u00e1zi.<\/p>\n\n\n\n

Samoz\u0159ejm\u011b, vytv\u00e1\u0159en\u00ed reviz\u00ed se d\u00e1 vypnout, nebo nastavit jejich omezen\u00ed, s t\u00edm, \u017ee budete ukl\u00e1dat t\u0159eba posledn\u00ed t\u0159i revize. My se ale budeme v\u011bnovat situaci, kdy jednodu\u0161e pot\u0159ebujete promazat datab\u00e1zi.<\/p>\n\n\n\n

Smaz\u00e1n\u00ed reviz\u00ed, pomoc\u00ed pluginu<\/h2>\n\n\n\n

Pokud chcete m\u00edt u\u017eivatelsk\u00e9 pohodl\u00ed, m\u016f\u017eete vyu\u017e\u00edt plugin, kter\u00fd se jmenuje Simple Revisions Delete<\/a><\/strong> . Plugin ned\u011bl\u00e1 nic jin\u00e9ho, ne\u017e co \u0159\u00edk\u00e1 jeho n\u00e1zev a najdete jej na WordPress.org.<\/p>\n\n\n

\n
\"\"<\/figure><\/div>\n\n\n

Po nahr\u00e1n\u00ed jej aktivujete v seznamu plugin\u016f:<\/p>\n\n\n

\n
\"\"<\/figure><\/div>\n\n\n

Po aktivaci p\u0159ejdeme do p\u0159ehledu str\u00e1nek\/p\u0159\u00edsp\u011bvk\u016f, vybereme p\u0159\u00edsp\u011bvky a pou\u017eijeme „purge revisions“.<\/p>\n\n\n

\n
\"\"<\/figure><\/div>\n\n\n

Po smaz\u00e1n\u00ed, doporu\u010duji je\u0161t\u011b optimalizovat datab\u00e1zi. Nic v\u00edce nen\u00ed pot\u0159eba, plugin je jednoduch\u00fd na pou\u017e\u00edv\u00e1n\u00ed.<\/p>\n\n\n\n

Smaz\u00e1n\u00ed reviz\u00ed, pomoc\u00ed SQL<\/h2>\n\n\n\n

V p\u0159\u00edpad\u011b, \u017ee pou\u017e\u00edv\u00e1te \u010dasto nap\u0159\u00edklad phpMyAdmin, nebo v\u00e1m p\u0159ijde odstran\u011bn\u00ed reviz\u00ed pomoc\u00ed SQL jednodu\u0161\u0161\u00ed, ne\u017e instalovat plugin, m\u016f\u017eete pou\u017e\u00edt n\u00e1sleduj\u00edc\u00ed k\u00f3d:<\/p>\n\n\n\n

DELETE a,b,c FROM wp_posts a LEFT JOIN wp_term_relationships b ON (a.ID = b.object_id) LEFT JOIN wp_postmeta c ON (a.ID = c.post_id) WHERE a.post_type = ‚revision‘<\/p>\n\n\n\n

Pou\u017eit\u00ed je bez z\u00e1ruky, p\u0159ed pou\u017eit\u00edm si z\u00e1lohujte datab\u00e1zi,za p\u0159\u00edpadn\u00e9 po\u0161kozen\u00ed nenesu \u017e\u00e1dnou zodpov\u011bdnost.<\/p>\n","protected":false},"excerpt":{"rendered":"

Aktualizov\u00e1no 21.03.2024 Ka\u017ed\u00fd rozpracovan\u00fd \u010dl\u00e1nek, ukl\u00e1d\u00e1 WordPress v pr\u016fb\u011bhu pr\u00e1ce, jako revizi. D\u00edky t\u00e9to super vlastnosti, se m\u016f\u017eete vr\u00e1tit v p\u0159\u00edpad\u011b, \u017ee ud\u011bl\u00e1te chybu. U rozs\u00e1hlej\u0161\u00edch web\u016f, mohou takov\u00e9 nepot\u0159ebn\u00e9 revize, zab\u00edrat zna\u010dn\u00e9 mno\u017estv\u00ed prostoru v datab\u00e1zi. Samoz\u0159ejm\u011b, vytv\u00e1\u0159en\u00ed reviz\u00ed se d\u00e1 vypnout, nebo nastavit jejich omezen\u00ed, s t\u00edm, \u017ee budete ukl\u00e1dat t\u0159eba posledn\u00ed t\u0159i<\/p>\n","protected":false},"author":1,"featured_media":8609,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[],"class_list":["post-2717","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-navody"],"_links":{"self":[{"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/posts\/2717"}],"collection":[{"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/comments?post=2717"}],"version-history":[{"count":0,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/posts\/2717\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/media\/8609"}],"wp:attachment":[{"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/media?parent=2717"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/categories?post=2717"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/affinite.io\/cs\/wp-json\/wp\/v2\/tags?post=2717"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}