/** * Plugin Name: Delete Non-English Posts (one-time tool) * Description: Adds Tools > Delete Non-English Posts. Trashes or permanently deletes a fixed list * of 1,022 non-English post IDs. Nothing is deleted until you press a button there. * Version: 1.0 * * HOW TO USE (pick one) * --------------------- * A) Install the free plugin "Code Snippets" > Snippets > Add New > paste this whole file > * Save Changes > Activate. Then open Tools > Delete Non-English Posts. * B) Or upload this file to /wp-content/mu-plugins/delete-non-english-posts.php * (create the mu-plugins folder if it does not exist). No activation needed. * * When finished, deactivate the snippet or delete the file. */ if ( ! defined( 'ABSPATH' ) ) { exit; } define( 'DNEP_IDS', '28,29,30,31,43,45,55,57,58,69,70,84,85,95,96,97,98,163,406,408,410,596,2034,18382,20501,20530,20538,20541,20543,20547,20550,20554,20558,20560,20599,20617,20625,20652,20654,20656,20658,20660,20662,20667,20669,20671,20673,20675,20681,20683,20696,20700,20702,20704,20708,20710,20714,20716,20718,20720,' . '20722,20724,20728,20730,20732,20734,20736,20859,20958,20964,20979,20992,20996,21103,21108,21120,22842,22865,23058,23105,23260,23262,23264,23266,23268,23270,23272,23274,23276,23278,23280,23282,23284,23286,23288,23331,23335,23337,23339,23341,23343,23345,23347,23349,23351,23353,23355,23357,23359,23361,23363,23365,23367,23369,23371,23373,23375,23377,23425,23427,' . '23429,23431,23433,23435,23437,23439,23441,23443,23445,23447,23449,23451,23453,23455,23457,23459,23461,23463,23465,23467,23469,23471,23473,23475,23477,23479,23481,23483,23500,23566,23570,23574,23578,23582,23586,23590,23592,23594,23596,23598,23600,23602,23604,23606,23608,23610,23612,23614,23616,23618,23620,23622,23624,23626,23628,23630,23632,23634,23637,23639,' . '23642,23646,23648,23650,23652,23654,23656,23658,24148,24150,24152,24154,24156,24158,24160,24162,24164,24166,24168,24170,24193,24297,25453,25575,25905,26003,26184,27363,27646,27944,27977,29505,31612,31663,32641,32963,33060,33278,33300,33302,33428,33430,33432,33434,33436,33438,33440,33442,33444,33446,33448,33450,33452,33454,33455,33458,33459,33462,33464,33466,' . '33468,33469,33472,33474,33476,33478,33480,33482,33484,33486,33488,33490,33491,33494,33496,33498,33501,33503,33505,33507,33509,33511,33513,33515,33516,33519,33520,33523,33594,33596,33598,33600,33602,33604,33606,34341,34464,34552,34725,35012,35095,35513,36205,37231,37249,37353,37500,37656,37747,37773,38346,38704,38846,38870,38872,38877,38916,38976,39417,39439,' . '39519,40072,40615,40711,40712,40713,40715,40716,40717,41431,41434,41436,41437,41439,41441,41445,41448,41462,41471,41473,41478,41485,41487,41491,41493,41495,41496,41498,41501,41505,41507,41509,41510,41512,41514,41516,41518,41522,41526,41530,41534,41538,41542,41546,41550,41581,41583,41585,41587,41590,41592,41593,41595,41598,41600,41603,41605,41608,41610,41612,' . '41614,41618,41620,41623,41630,41633,41643,41650,41654,41658,41661,41664,41666,41668,41672,41673,41677,41680,41681,41685,41688,41691,41694,41697,41698,41701,41704,41707,41711,41714,41717,41722,41725,41727,41729,41730,41732,41734,41737,41739,41741,41743,41746,41748,41752,41757,41759,41760,41762,41765,41766,41769,41771,41776,41779,41780,41785,41787,41789,41798,' . '41799,41801,41803,41805,41810,41812,41820,41822,41824,41826,41829,41830,41833,41836,41838,41839,41841,41844,41845,41846,41849,41851,41854,41857,41858,41861,41862,41864,41866,41873,41874,41877,41879,41881,41884,41885,41895,41898,41900,41902,41904,41914,41916,41951,41953,41957,41958,41963,41965,41966,41967,41969,41970,41972,41974,41976,41978,41980,41986,41990,' . '41991,41994,41995,41997,41999,42001,42004,42009,42011,42013,42015,42017,42020,42021,42028,42029,42031,42034,42035,42037,42041,42043,42044,42047,42054,42059,42120,42122,42123,42125,42127,42129,42131,42133,42135,42138,42139,42142,42144,42145,42147,42152,42154,42156,42158,42162,42164,42172,42173,42175,42178,42179,42185,42188,42192,42195,42199,42204,42207,42208,' . '42214,42216,42289,42308,42310,42313,42315,42317,42318,42319,42324,42334,42335,42337,42340,42344,42346,42351,42353,42355,42359,42368,42373,42375,42379,42381,42383,42389,42391,42392,42394,42395,42397,42399,42401,42402,42404,42407,42408,42430,42432,42435,42437,42440,42446,42447,42449,42452,42453,42455,42458,42459,42461,42464,42466,42468,42469,42476,42478,42485,' . '42488,42491,42494,42495,42498,42504,42510,42514,42518,42519,42521,42523,42526,42528,42530,42532,42543,42546,42549,42551,42554,42555,42558,42560,42561,42563,42565,42568,42570,42574,42575,42577,42582,42585,42586,42589,42590,42595,42597,42598,42600,42602,42604,42607,42612,42615,42616,42618,42621,42624,42626,42627,42630,42632,42635,42637,42638,42640,42646,42647,' . '42649,42655,42657,42659,42660,42662,42665,42671,42673,42676,42678,42682,42685,42687,42695,42697,42700,42702,42704,42707,42709,42711,42715,42719,42721,42723,42726,42735,42737,42740,42741,42744,42746,42748,42750,42751,42753,42755,42760,42761,42766,42768,42770,42773,42774,42777,42781,42783,42784,42786,42793,42800,42806,42808,42809,42811,42813,42815,42819,42821,' . '42822,42825,42826,42828,42830,42832,42834,42843,42847,42849,42854,42860,42866,42868,42870,42872,42875,42877,42881,42882,42885,42887,42895,42896,42898,42904,42912,42914,42916,42918,42921,42924,42926,42930,42934,42938,42940,42959,42964,42969,42970,42983,42986,42992,42995,42997,43002,43003,43020,43026,43028,43032,43036,43042,43059,43060,43061,43064,43070,43072,' . '43076,43079,43082,43086,43088,43090,43092,43095,43099,43105,43108,43111,43115,43119,43124,43126,43128,43129,43131,43133,43139,43141,43145,43146,43148,43149,43162,43163,43165,43168,43170,43175,43178,43181,43191,43193,43195,43196,43199,43201,43205,43214,43216,43224,43228,43229,43234,43236,43242,43245,43246,43256,43260,43262,43264,43265,43271,43273,43275,43277,' . '43279,43282,43283,43285,43292,43296,43300,43303,43307,43310,43313,43316,43319,43323,43324,43326,43330,43331,43335,43337,43338,43340,43343,43345,43347,43349,43351,43355,43356,43358,43360,43361,43363,43366,43369,43370,43373,43378,43380,43382,43384,43386,43389,43399,43403,43404,43407,43415,43424,43426,43431,43433,43435,43443,43448,43450,43455,43458,43460,43463,' . '43464,43466,43470,43472,43474,43477,43479,43480,43482,43489,43491,43497,43498,43500,43502,43506,43511,43520,43524,43527,43530,43536,43541,43542,43549,43551,43553,43555,43561,43563,43569,43572,43573,43579,43582,43585,43588,43591,43593,43597,43601,43604,43609,43613,43614,43616,43631,43633,43635,43637,43641,43643,43645,43646,43648,43650,43652,43656,43657,43660,' . '43662,43671,43673,43675,43677,43679,43681,43683,43685,43706,43709,43711,43713,43715,43725,43727,43729,43731,43737,43739,43742,43745,43747,43749,43754,43757,43759,43761,43763,43764,43767,43769,43771,43803,43805,43862,43865,43882,43889,43894,43897,43899,43936,43948,43950,43976,43978,44007,44025,44026,44028,44032,44035,44050,44114,44146,44148,44149,44151,44154,' . '44158,44163' ); add_action( 'admin_menu', function () { add_management_page( 'Delete Non-English Posts', 'Delete Non-English Posts', 'manage_options', 'delete-non-english-posts', 'dnep_page' ); } ); function dnep_ids() { static $ids = null; if ( null === $ids ) { $ids = array_values( array_unique( array_filter( array_map( 'intval', explode( ',', DNEP_IDS ) ) ) ) ); } return $ids; } function dnep_page() { if ( ! current_user_can( 'manage_options' ) ) { wp_die( 'No permission.' ); } global $wpdb; $ids = dnep_ids(); $in = implode( ',', array_map( 'intval', $ids ) ); // safe: integers only $result = ''; $action = isset( $_POST['dnep_action'] ) ? sanitize_text_field( $_POST['dnep_action'] ) : ''; if ( $action && check_admin_referer( 'dnep_do' ) ) { @set_time_limit( 0 ); ignore_user_abort( true ); wp_defer_term_counting( true ); $permanent = ( 'delete' === $action ); $n = 0; foreach ( $ids as $id ) { $post = get_post( $id ); if ( $post && 'post' === $post->post_type ) { wp_delete_post( $id, $permanent ); // false = Trash, true = delete forever $n++; } } wp_defer_term_counting( false ); $result = '

Done. ' . intval( $n ) . ' posts ' . ( $permanent ? 'permanently deleted.' : 'moved to Trash.' ) . '

'; $result .= '

Next: flush/rebuild your sitemap in the SEO plugin, clear the site cache, ' . 'and resubmit the sitemap in Google Search Console.

'; } $existing = intval( $wpdb->get_var( "SELECT COUNT(*) FROM {$wpdb->posts} WHERE ID IN ($in) AND post_type = 'post'" ) ); $trash = intval( $wpdb->get_var( "SELECT COUNT(*) FROM {$wpdb->posts} WHERE ID IN ($in) AND post_type = 'post' AND post_status = 'trash'" ) ); echo '

Delete Non-English Posts

'; echo $result; echo '
'; echo '

Post IDs in this list: ' . count( $ids ) . '

'; echo '

Matching posts currently on the site: ' . $existing . ( $trash ? '  (' . $trash . ' already in Trash)' : '' ) . '

'; echo '

Warning: "Delete permanently" cannot be undone. ' . 'Take a backup first, or use "Move to Trash" so you can restore if needed.

'; if ( $existing > 0 ) { echo '
'; wp_nonce_field( 'dnep_do' ); echo '

  '; echo '

'; } else { echo '

Nothing left to delete — these IDs are already gone. ' . 'You can deactivate this snippet / delete this file now.

'; } $preview = $wpdb->get_results( "SELECT ID, post_title FROM {$wpdb->posts} WHERE ID IN ($in) AND post_type = 'post' ORDER BY ID LIMIT 15" ); if ( $preview ) { echo '

Preview (first ' . count( $preview ) . ')

    '; foreach ( $preview as $p ) { echo '
  1. #' . intval( $p->ID ) . ' — ' . esc_html( $p->post_title ) . '
  2. '; } echo '
'; } echo '
'; } https://www.tipsnsolution.in/post-sitemap1.xml 2026-09-12T16:25:03+00:00 https://www.tipsnsolution.in/post-sitemap2.xml 2026-09-12T16:24:52+00:00 https://www.tipsnsolution.in/post-sitemap3.xml 2026-09-12T16:24:16+00:00 https://www.tipsnsolution.in/post-sitemap4.xml 2026-06-05T00:44:47+00:00 https://www.tipsnsolution.in/post-sitemap5.xml 2026-05-17T01:11:35+00:00 https://www.tipsnsolution.in/post-sitemap6.xml 2026-05-17T00:18:40+00:00 https://www.tipsnsolution.in/post-sitemap7.xml 2026-05-06T13:31:57+00:00 https://www.tipsnsolution.in/post-sitemap8.xml 2026-04-04T01:41:57+00:00 https://www.tipsnsolution.in/post-sitemap9.xml 2026-04-04T01:34:57+00:00 https://www.tipsnsolution.in/post-sitemap10.xml 2026-04-04T01:31:47+00:00 https://www.tipsnsolution.in/post-sitemap11.xml 2026-01-30T10:30:59+00:00 https://www.tipsnsolution.in/post-sitemap12.xml 2025-12-17T16:37:35+00:00 https://www.tipsnsolution.in/post-sitemap13.xml 2025-12-09T07:52:39+00:00 https://www.tipsnsolution.in/post-sitemap14.xml 2025-09-30T06:05:14+00:00 https://www.tipsnsolution.in/post-sitemap15.xml 2025-09-24T13:43:32+00:00 https://www.tipsnsolution.in/post-sitemap16.xml 2025-09-23T13:22:41+00:00 https://www.tipsnsolution.in/post-sitemap17.xml 2025-09-20T07:17:00+00:00 https://www.tipsnsolution.in/post-sitemap18.xml 2025-09-03T15:10:20+00:00 https://www.tipsnsolution.in/post-sitemap19.xml 2025-07-15T02:18:00+00:00 https://www.tipsnsolution.in/post-sitemap20.xml 2025-06-23T11:14:48+00:00 https://www.tipsnsolution.in/post-sitemap21.xml 2025-06-23T11:13:27+00:00 https://www.tipsnsolution.in/post-sitemap22.xml 2025-03-28T01:33:23+00:00 https://www.tipsnsolution.in/post-sitemap23.xml 2025-03-08T09:16:55+00:00 https://www.tipsnsolution.in/post-sitemap24.xml 2025-03-06T04:20:17+00:00 https://www.tipsnsolution.in/post-sitemap25.xml 2025-01-18T19:10:54+00:00 https://www.tipsnsolution.in/post-sitemap26.xml 2025-01-18T17:48:39+00:00 https://www.tipsnsolution.in/post-sitemap27.xml 2025-01-18T17:31:21+00:00 https://www.tipsnsolution.in/post-sitemap28.xml 2025-01-18T12:27:07+00:00 https://www.tipsnsolution.in/post-sitemap29.xml 2025-01-18T11:38:32+00:00 https://www.tipsnsolution.in/post-sitemap30.xml 2025-01-18T09:47:51+00:00 https://www.tipsnsolution.in/post-sitemap31.xml 2025-01-18T09:45:03+00:00 https://www.tipsnsolution.in/post-sitemap32.xml 2025-01-18T09:09:02+00:00 https://www.tipsnsolution.in/post-sitemap33.xml 2025-01-18T08:40:32+00:00 https://www.tipsnsolution.in/page-sitemap.xml 2026-09-13T04:05:18+00:00 https://www.tipsnsolution.in/category-sitemap.xml 2026-09-12T16:25:03+00:00 https://www.tipsnsolution.in/author-sitemap.xml 2026-09-13T09:35:18+00:00