{"id":10346,"date":"2025-06-08T23:47:01","date_gmt":"2025-06-08T22:47:01","guid":{"rendered":"https:\/\/stevepedwards.today\/DebianAdmin\/?p=10346"},"modified":"2025-07-03T17:35:18","modified_gmt":"2025-07-03T16:35:18","slug":"clean-up-duplicate-posts-gem-ai","status":"publish","type":"post","link":"https:\/\/stevepedwards.today\/DebianAdmin\/clean-up-duplicate-posts-gem-ai\/","title":{"rendered":"Clean Up Duplicate Posts &#8211; Gem AI"},"content":{"rendered":"<div class=\"pvc_clear\"><\/div>\n<p id=\"pvc_stats_10346\" class=\"pvc_stats all  \" data-element-id=\"10346\" style=\"\"><i class=\"pvc-stats-icon medium\" aria-hidden=\"true\"><svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"far\" data-icon=\"chart-bar\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\" class=\"svg-inline--fa fa-chart-bar fa-w-16 fa-2x\"><path fill=\"currentColor\" d=\"M396.8 352h22.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-192 0h22.4c6.4 0 12.8-6.4 12.8-12.8V140.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h22.4c6.4 0 12.8-6.4 12.8-12.8V204.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zM496 400H48V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zm-387.2-48h22.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8z\" class=\"\"><\/path><\/svg><\/i> <img loading=\"lazy\" decoding=\"async\" width=\"16\" height=\"16\" alt=\"Loading\" src=\"https:\/\/stevepedwards.today\/DebianAdmin\/wp-content\/plugins\/page-views-count\/ajax-loader-2x.gif\" border=0 \/><\/p>\n<div class=\"pvc_clear\"><\/div>\n<ol data-sourcepos=\"26:1-72:0\">\n<li data-sourcepos=\"29:1-40:0\">\n<p data-sourcepos=\"29:5-29:33\"><strong>Identify Duplicate Slugs:<\/strong><\/p>\n<ul data-sourcepos=\"30:5-40:0\">\n<li data-sourcepos=\"30:5-30:94\">Go to the <code>wp_posts<\/code> table (your table prefix might be different, e.g., <code>wp_xyz_posts<\/code>).<\/li>\n<li data-sourcepos=\"31:5-31:196\">Look at the <code>post_name<\/code> column. You're looking for entries like <code>my-post<\/code>, <code>my-post-2<\/code>, <code>my-post-3<\/code>, etc., where the content is essentially the same or one is an older, now-obsolete version.<\/li>\n<li data-sourcepos=\"32:5-40:0\">You can run SQL queries to help identify these. For example:\n<div class=\"code-block ng-tns-c1180528678-19 ng-animate-disabled ng-trigger ng-trigger-codeBlockRevealAnimation\">\n<div class=\"code-block-decoration header-formatted gds-title-s ng-tns-c1180528678-19 ng-star-inserted\">\n<p><span class=\"ng-tns-c1180528678-19\">SQL<\/span><\/p>\n<div class=\"buttons ng-tns-c1180528678-19 ng-star-inserted\">mysql&gt; SELECT post_name, COUNT(*) as count<br \/>\n-&gt; FROM wp_xubg_posts<br \/>\n-&gt; WHERE post_status IN ('publish', 'draft', 'private') -- or just 'publish' if that's all you want to check<br \/>\n-&gt; GROUP BY post_name<br \/>\n-&gt; HAVING count &gt; 1;<br \/>\n+-------------------------------------------------------+-------+<br \/>\n| post_name | count |<br \/>\n+-------------------------------------------------------+-------+<br \/>\n| some-linux-one-line-cmds | 2 |<br \/>\n| linux-admin-webdev-beginner-to-intermediate-it-topics | 3 |<br \/>\n| win11-to-wsl2-networking-chat-with-gemini-ai-2025 | 2 |<br \/>\n+-------------------------------------------------------+-------+<br \/>\n3 rows in set (0.02 sec)<\/div>\n<div><\/div>\n<div class=\"buttons ng-tns-c1180528678-19 ng-star-inserted\">To delete leaving most recent entry:<\/div>\n<\/div>\n<\/div>\n<div class=\"code-block ng-tns-c1180528678-19 ng-animate-disabled ng-trigger ng-trigger-codeBlockRevealAnimation\">\n<div class=\"formatted-code-block-internal-container ng-tns-c1180528678-19\">\n<div class=\"animated-opacity ng-tns-c1180528678-19\">\n<pre class=\"ng-tns-c1180528678-19\"><code class=\"code-container formatted ng-tns-c1180528678-19\" role=\"text\" data-test-id=\"code-content\" data-sourcepos=\"33:9-38:25\">DELETE p1\r\nFROM wp_xubg_posts p1\r\nJOIN wp_xubg_posts p2 ON p1.post_name = p2.post_name\r\nWHERE p1.ID &lt; p2.ID\r\nAND p1.post_status IN ('publish', 'draft', 'private'); -- Adjust post_status as needed\r\n<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<p>view the 134 WANTED Posts currently in the DB:<\/p>\n<h3><b>Step 1: Preview the Posts\/Pages to be Deleted<\/b><\/h3>\n<p>&nbsp;<\/p>\n<p>Before deleting, run this <code>SELECT<\/code> query to see exactly which posts and pages (by <code>ID<\/code>, <code>post_title<\/code>, <code>post_type<\/code>, and <code>post_status<\/code>) will be affected. This will help you confirm that you're targeting the correct content.<\/p>\n<div class=\"code-block ng-tns-c4142113402-65 ng-animate-disabled ng-trigger ng-trigger-codeBlockRevealAnimation\">\n<div class=\"code-block-decoration header-formatted gds-title-s ng-tns-c4142113402-65 ng-star-inserted\">\n<p><span class=\"ng-tns-c4142113402-65\">SQL<\/span><\/p>\n<div class=\"buttons ng-tns-c4142113402-65 ng-star-inserted\"><\/div>\n<\/div>\n<div class=\"formatted-code-block-internal-container ng-tns-c4142113402-65\">\n<div class=\"animated-opacity ng-tns-c4142113402-65\">\n<pre class=\"ng-tns-c4142113402-65\"><code class=\"code-container formatted ng-tns-c4142113402-65\" role=\"text\" data-test-id=\"code-content\"><span class=\"hljs-keyword\">SELECT<\/span> ID, post_title, post_type, post_status\r\n<span class=\"hljs-keyword\">FROM<\/span> wp_xubg_posts\r\n<span class=\"hljs-keyword\">WHERE<\/span> post_type <span class=\"hljs-keyword\">IN<\/span> (<span class=\"hljs-string\">'post'<\/span>, <span class=\"hljs-string\">'page'<\/span>) <span class=\"hljs-keyword\">AND<\/span> post_status <span class=\"hljs-operator\">!=<\/span> <span class=\"hljs-string\">'publish'<\/span>;\r\n<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<p>Review the output carefully. If it lists the posts and pages you expect to remove, proceed to the next steps.<\/p>\n<hr \/>\n<p>&nbsp;<\/p>\n<h3><b>Step 2: Delete Associated Comments<\/b><\/h3>\n<p>&nbsp;<\/p>\n<p>This command will delete all comments linked to the posts and pages that are not in the 'publish' status.<\/p>\n<div class=\"code-block ng-tns-c4142113402-66 ng-animate-disabled ng-trigger ng-trigger-codeBlockRevealAnimation\">\n<div class=\"code-block-decoration header-formatted gds-title-s ng-tns-c4142113402-66 ng-star-inserted\">\n<p><span class=\"ng-tns-c4142113402-66\">SQL<\/span><\/p>\n<div class=\"buttons ng-tns-c4142113402-66 ng-star-inserted\"><\/div>\n<\/div>\n<div class=\"formatted-code-block-internal-container ng-tns-c4142113402-66\">\n<div class=\"animated-opacity ng-tns-c4142113402-66\">\n<pre class=\"ng-tns-c4142113402-66\"><code class=\"code-container formatted ng-tns-c4142113402-66\" role=\"text\" data-test-id=\"code-content\"><span class=\"hljs-keyword\">DELETE<\/span> <span class=\"hljs-keyword\">FROM<\/span> wp_xubg_comments\r\n<span class=\"hljs-keyword\">WHERE<\/span> comment_post_ID <span class=\"hljs-keyword\">IN<\/span> (\r\n    <span class=\"hljs-keyword\">SELECT<\/span> ID\r\n    <span class=\"hljs-keyword\">FROM<\/span> wp_xubg_posts\r\n    <span class=\"hljs-keyword\">WHERE<\/span> post_type <span class=\"hljs-keyword\">IN<\/span> (<span class=\"hljs-string\">'post'<\/span>, <span class=\"hljs-string\">'page'<\/span>) <span class=\"hljs-keyword\">AND<\/span> post_status <span class=\"hljs-operator\">!=<\/span> <span class=\"hljs-string\">'publish'<\/span>\r\n);\r\n<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<hr \/>\n<p>&nbsp;<\/p>\n<h3><b>Step 3: Delete Associated Post Metadata<\/b><\/h3>\n<p>&nbsp;<\/p>\n<p>This command will delete all post metadata (custom fields, etc.) linked to the posts and pages that are not in the 'publish' status.<\/p>\n<div class=\"code-block ng-tns-c4142113402-67 ng-animate-disabled ng-trigger ng-trigger-codeBlockRevealAnimation\">\n<div class=\"code-block-decoration header-formatted gds-title-s ng-tns-c4142113402-67 ng-star-inserted\">\n<p><span class=\"ng-tns-c4142113402-67\">SQL<\/span><\/p>\n<div class=\"buttons ng-tns-c4142113402-67 ng-star-inserted\"><\/div>\n<\/div>\n<div class=\"formatted-code-block-internal-container ng-tns-c4142113402-67\">\n<div class=\"animated-opacity ng-tns-c4142113402-67\">\n<pre class=\"ng-tns-c4142113402-67\"><code class=\"code-container formatted ng-tns-c4142113402-67\" role=\"text\" data-test-id=\"code-content\"><span class=\"hljs-keyword\">DELETE<\/span> <span class=\"hljs-keyword\">FROM<\/span> wp_xubg_postmeta\r\n<span class=\"hljs-keyword\">WHERE<\/span> post_id <span class=\"hljs-keyword\">IN<\/span> (\r\n    <span class=\"hljs-keyword\">SELECT<\/span> ID\r\n    <span class=\"hljs-keyword\">FROM<\/span> wp_xubg_posts\r\n    <span class=\"hljs-keyword\">WHERE<\/span> post_type <span class=\"hljs-keyword\">IN<\/span> (<span class=\"hljs-string\">'post'<\/span>, <span class=\"hljs-string\">'page'<\/span>) <span class=\"hljs-keyword\">AND<\/span> post_status <span class=\"hljs-operator\">!=<\/span> <span class=\"hljs-string\">'publish'<\/span>\r\n);\r\n<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<hr \/>\n<p>&nbsp;<\/p>\n<h3><b>Step 4: Delete the Posts and Pages Themselves<\/b><\/h3>\n<p>&nbsp;<\/p>\n<p>Finally, this command will delete the actual post and page entries that are not in the 'publish' status.<\/p>\n<div class=\"code-block ng-tns-c4142113402-68 ng-animate-disabled ng-trigger ng-trigger-codeBlockRevealAnimation\">\n<div class=\"code-block-decoration header-formatted gds-title-s ng-tns-c4142113402-68 ng-star-inserted\">\n<p><span class=\"ng-tns-c4142113402-68\">SQL<\/span><\/p>\n<div class=\"buttons ng-tns-c4142113402-68 ng-star-inserted\"><\/div>\n<\/div>\n<div class=\"formatted-code-block-internal-container ng-tns-c4142113402-68\">\n<div class=\"animated-opacity ng-tns-c4142113402-68\">\n<pre class=\"ng-tns-c4142113402-68\"><code class=\"code-container formatted ng-tns-c4142113402-68\" role=\"text\" data-test-id=\"code-content\"><span class=\"hljs-keyword\">DELETE<\/span> <span class=\"hljs-keyword\">FROM<\/span> wp_xubg_posts\r\n<span class=\"hljs-keyword\">WHERE<\/span> post_type <span class=\"hljs-keyword\">IN<\/span> (<span class=\"hljs-string\">'post'<\/span>, <span class=\"hljs-string\">'page'<\/span>) <span class=\"hljs-keyword\">AND<\/span> post_status <span class=\"hljs-operator\">!=<\/span> <span class=\"hljs-string\">'publish'<\/span>;\r\n<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<hr \/>\n<p>After running these commands, you can run the <code>SELECT<\/code> query from Step 1 again, and it should return an empty set if all non-published posts and pages have been successfully removed. Your attachments should still be present in the media library, although they might appear as \"unattached\" if their parent posts were deleted.<\/p>\n<p>This gives a list of Posts with their publish date:SELECT ID, post_title, post_date<br \/>\nmysql&gt; SELECT ID, post_title, post_date FROM wp_xubg_posts WHERE post_type IN ('post', 'page') AND post_status = 'publish';<br \/>\n+-------+------------------------------------------------------------------------------------------------------------+---------------------+<br \/>\n| ID | post_title | post_date |<br \/>\n+-------+------------------------------------------------------------------------------------------------------------+---------------------+<br \/>\n| 10526 | Old Main Page - Linux Admin &amp; WebDev | 2014-04-02 15:31:26 |<br \/>\n| 2055 | Notepad | 2015-08-30 22:18:39 |<br \/>\n| 3843 | File Downloads | 2016-08-06 22:21:13 |<br \/>\n| 3863 | Brief History of Unix\/Hackerdom | 2016-08-07 23:48:59 |<br \/>\n| 4339 | Awk\/Perl\/SED Notepad | 2016-08-21 21:16:07 |<br \/>\n| 5456 | Steve Edwards CV | 2016-10-31 21:11:22 |<br \/>\n| 8869 | Databases \u2013 My Research Paper 2009 | 2019-12-15 07:43:48 |<br \/>\n| 8565 | Statistical Investigation of Aloha Packet Radio Transmission | 2020-01-03 10:52:18 |<br \/>\n| 8871 | 5 Day Linux Introduction Course | 2020-01-26 06:11:54 |<br \/>\n| 10245 | Windows Powershell Commands | 2025-05-31 00:56:57 |<br \/>\n| 10270 | Linux History Examples 2025 | 2025-05-31 08:57:33 |<br \/>\n| 10412 | AI Powered Semantic Posts Search | 2025-06-28 01:18:23 |<br \/>\n| 10527 | Linux, Windows, Comms, IT and AI Topics | 2025-06-28 01:18:23 |<br \/>\n| 10463 | LLM WSL2 Services Start Command | 2025-06-30 06:14:08 |<br \/>\n| 10118 | Databases \u2013 A Research Paper 2009 | 2009-03-01 02:53:46 |<br \/>\n| 53 | Re-install Win 7 With No DVD and Replace Laptop Auto Recovery Partition | 2014-04-05 11:29:15 |<br \/>\n| 146 | Cool Command #1 - DD with Progress | 2014-04-09 17:41:20 |<br \/>\n| 181 | Cool Command #2, Find with -exec or -delete or pipe to xargs rm -v | 2014-04-13 02:21:50 |<br \/>\n| 230 | Cool Command #3 Rsync | 2014-04-17 17:10:23 |<br \/>\n| 286 | Simple WordPress CSS Text Size and Color Tweaks | 2014-04-20 02:38:50 |<br \/>\n| 319 | William Shotts SysInfo.html Creator Script | 2014-04-21 16:57:07 |<br \/>\n| 410 | Basic Security Concepts - Principles For Any System or OS | 2014-11-09 20:37:43 |<br \/>\n| 412 | Recover Your Data and PC | 2014-11-09 20:43:40 |<br \/>\n| 772 | File Recovery with TestDisk + Photorec | 2014-11-27 20:13:29 |<br \/>\n| 776 | Cool Cmd #6 - dd_rescue | 2014-11-27 20:35:05 |<br \/>\n| 863 | Cryptography + Encryption | 2015-01-10 19:49:18 |<br \/>\n| 978 | Linux Commands + Packages - How Many, and What For? | 2015-01-29 21:18:29 |<br \/>\n| 1075 | Basic Maths and Ideas Behind Password Complexity | 2015-02-24 01:25:20 |<br \/>\n| 1322 | Setup and Access a 1TB FAT32 USB Share on a Draytek Router | 2015-07-10 21:48:39 |<br \/>\n| 1469 | Mint as a PXE Server for PartedMagic and Multi OSs | 2015-07-25 01:56:35 |<br \/>\n| 1540 | PXE Menu Issues and ISO Boot File Problems | 2015-07-31 14:39:34 |<br \/>\n| 1603 | AVCONV Video Format Conversion Command Line Structure | 2015-08-03 15:28:31 |<br \/>\n| 1624 | First Python Scripts For Pi Camera | 2015-08-04 21:12:06 |<br \/>\n| 1697 | Testing Webcams With fswebcam, Pi Noir Picam and Remote View of Motion on the Pi | 2015-08-09 03:14:24 |<br \/>\n| 1787 | Working Motion Installs On 2 Identically Setup Pi2's | 2015-08-11 15:06:35 |<br \/>\n| 1805 | Using Sendemail + Curl For a Motion Alert and Hacking Its 2+ year old Perl TLS Bug | 2015-08-13 15:47:21 |<br \/>\n| 1915 | Adding a SSH Share Using SSHFS and Viewing Netstat | 2015-08-20 16:07:32 |<br \/>\n| 1941 | Using Awk, Sed, Cut and TR To Cut a Column List for Character Substitution and Nmap Bad Ports List | 2015-08-21 20:57:50 |<br \/>\n| 2007 | Basic Rsync Usage Summaries from Man Page | 2015-08-23 12:32:39 |<br \/>\n| 2026 | Fix Double Minus Sign Problem in WordPress in Theme Functions php | 2015-08-24 11:30:53 |<br \/>\n| 2087 | Cool Command #8 - lsof | 2015-08-31 11:39:34 |<br \/>\n| 2219 | Using and finding the attribute of i assigned to a file with chattr and lsattr | 2015-09-09 16:11:41 |<br \/>\n| 2226 | Understanding Basic Ideas Behind Optimised Code and Erastosthenes Sieve | 2015-09-10 23:36:41 |<br \/>\n| 2274 | Using Crontab to Automate Commands on Schedule and with Poweroff | 2015-09-17 19:27:40 |<br \/>\n| 10122 | Some Linux One Line Cmds | 2015-09-24 03:00:55 |<br \/>\n| 2354 | SED Basics using O_Reilly.pdf example, and Unexpected Mind-Bending Parsing Behaviour | 2015-10-01 18:17:18 |<br \/>\n| 2373 | When students ask: What's an IP Address? | 2015-10-20 14:19:16 |<br \/>\n| 2414 | Home Made Outdoor Surveillance PiCams, Pi Cam's IR Sensitivity, with TalkTalk Powerline | 2015-10-28 21:14:09 |<br \/>\n| 2555 | Issues Writing with DD to dev_sr0 With Blank DVDs | 2015-11-10 10:13:20 |<br \/>\n| 2668 | Encapsulation - From Bits to Gigabytes in 200 Years | 2016-03-17 21:46:51 |<br \/>\n| 2891 | Testing graphics (PCIE) cards with phoronix-test-suite | 2016-03-28 22:19:34 |<br \/>\n| 2972 | Cool Command #10 - mogrify | 2016-04-25 17:17:22 |<br \/>\n| 3020 | Multi Picam Webserver | 2016-05-26 23:26:32 |<br \/>\n| 3051 | Chapters 1-4 Notes - Practical C Programming, 3rd Edition By Steve Oualline | 2016-06-06 16:54:45 |<br \/>\n| 8885 | Chapter 5 Notes \u2013 Practical C Programming, 3rd Edition By Steve Oualline | 2016-06-07 14:53:32 |<br \/>\n| 3070 | Chapter 6 Notes Practical C Programming, 3rd Edition By Steve Oualline | 2016-06-07 23:35:25 |<br \/>\n| 8887 | Chapter 7 Notes \u2013 Practical C Programming, 3rd Edition By Steve Oualline | 2016-06-08 18:09:26 |<br \/>\n| 3097 | Chapter 8 Notes Practical C Programming, 3rd Edition By Steve Oualline | 2016-06-09 23:55:36 |<br \/>\n| 3198 | Creating an eBook PDF from your WordPress Posts | 2016-06-23 19:44:48 |<br \/>\n| 3212 | Chapter 9 Notes Practical C Programming, 3rd Edition By Steve Oualline | 2016-06-25 13:00:06 |<br \/>\n| 3236 | Practical C Programming - Switch and Nested Switches Example | 2016-06-26 17:01:31 |<br \/>\n| 3264 | Practical C Programming - Unitsconverter Prog: using fmod for float remainder | 2016-06-28 21:43:22 |<br \/>\n| 3306 | Post New Mint Install Tweaks Options | 2016-07-01 16:22:41 |<br \/>\n| 3315 | Experiment with Pipes, Redirection, Command Substitution and Variable Expansion | 2016-07-04 02:21:32 |<br \/>\n| 3344 | Setting Sudo Users with Adduser and Visudo in Mint and Raspbian | 2016-07-06 01:02:54 |<br \/>\n| 3404 | Remote Server gkrellm Monitors or Other GUI Apps via SSH and X11 | 2016-07-09 23:52:50 |<br \/>\n| 3450 | Exploring Find Cmd Options - file types you may want to find...and go insane trying | 2016-07-14 19:00:33 |<br \/>\n| 8890 | Exploring Find Cmd Options \u2013 Continuing With Metacharacters | 2016-07-22 00:18:09 |<br \/>\n| 3831 | An Intro to Metachar Search Methods, Wreck the MP3s | 2016-08-06 17:50:12 |<br \/>\n| 3944 | Intro to Gnuplot | 2016-08-10 23:42:28 |<br \/>\n| 3962 | Flame Graphs by www.brendangregg.com - Intro to System Profiling and Admin Tools | 2016-08-11 19:31:02 |<br \/>\n| 4027 | Linux Performance Tools List Check Utilisation, Saturation, Errors (USE) | 2016-08-13 13:27:14 |<br \/>\n| 4041 | How Slow Can You Go? Old and New Tech Moore's Law Comparison - Hard Drives | 2016-08-14 22:36:40 |<br \/>\n| 4145 | Gnuplot - Basic Starter Example Data File for System Profile Plots | 2016-08-17 15:36:29 |<br \/>\n| 4188 | Gnuplot - Basic Ideas to Capture Live System Data | 2016-08-18 15:56:30 |<br \/>\n| 4246 | How Slow Can You Go? Sysbench Comparisons - CPUs | 2016-08-20 16:04:29 |<br \/>\n| 4262 | How Slow Can You Go? Sysbench Comparisons - Memory | 2016-08-20 18:08:01 |<br \/>\n| 4281 | How Slow Can You Go? Sysbench Comparisons Disk\/File IO | 2016-08-20 19:29:10 |<br \/>\n| 4302 | CPU Bound Loop to Load 1 CPU Core to 100% to Test Observability Tools | 2016-08-20 23:59:25 |<br \/>\n| 10120 | Awk\/Perl\/SED Notepad | 2016-08-21 02:56:41 |<br \/>\n| 4320 | Sysbench - Simulated Database Testing | 2016-08-21 15:47:56 |<br \/>\n| 4463 | Converting m4a to mp3 | 2016-08-26 21:58:03 |<br \/>\n| 4553 | Printing (LIVE!) ASCII Histograms from Numeric Data Output + Files | 2016-08-30 16:56:15 |<br \/>\n| 4716 | Developing One Liners with Command Substitution | 2016-09-05 14:41:01 |<br \/>\n| 4777 | AWK as a Limited Spreadsheet Simulation for Stats | 2016-09-13 09:43:26 |<br \/>\n| 4838 | Save Gigabytes of Failed Rsync Video Transfers on a Drive | 2016-09-17 16:39:57 |<br \/>\n| 4923 | Intro to Software Defined Radio - FM Stations and Tracking Aircraft | 2016-09-24 15:42:39 |<br \/>\n| 5212 | Small Business Data Security Requirements Summary | 2016-10-18 13:19:54 |<br \/>\n| 5864 | Cisco Setup via Linux - Serial Port Connection | 2017-01-09 17:45:05 |<br \/>\n| 5914 | Cisco Setup ADSL Connection (WAN) | 2017-01-09 23:40:29 |<br \/>\n| 5949 | Cisco Setup NAT Connections (LAN to WAN), ACLs, DNS and DHCP Server | 2017-01-10 16:50:32 |<br \/>\n| 5985 | Cisco Setup ACL Settings and Basic Routing Concepts | 2017-01-10 23:37:21 |<br \/>\n| 5995 | Cisco Setup WiFi LAN and NTP - Full Config + Password Reset + Webpage Access | 2017-01-11 00:21:22 |<br \/>\n| 6075 | Slick Canon Printer Support for Linux - How Corporations Should Do It... | 2017-01-18 21:55:00 |<br \/>\n| 6124 | Cheap But Handy USB\/SATA\/IDE Backup Gizmos from the Web | 2017-01-20 13:29:48 |<br \/>\n| 6297 | DD and Cloning Windows System Drives | 2017-01-22 20:23:26 |<br \/>\n| 6403 | Personal Data Awareness for Broken\/Stolen PCs - The Data People Give Away! Use Shred\/Other App | 2017-01-28 17:10:34 |<br \/>\n| 6941 | Backing Up Working Picam Images Over the Net With dd and Netcat | 2017-02-22 09:11:24 |<br \/>\n| 7099 | Check Working Keys Using Ubuntu's Handy Utility | 2017-03-08 13:36:47 |<br \/>\n| 7361 | WordPress Upload Limit - .user.ini | 2017-09-08 20:08:25 |<br \/>\n| 7451 | Booting a Pi3 from USB3 Devices | 2017-10-05 15:45:15 |<br \/>\n| 7470 | Pi3 USB Boot Device with Picam Motion | 2017-10-05 18:17:29 |<br \/>\n| 7729 | WP Info\/Search Replace on CMD Line\/vsftpd | 2018-01-24 02:00:39 |<br \/>\n| 8627 | New Mint Install and Want WordPress at Home? Full Steps I Take...\u00a0 | 2018-01-24 02:00:39 |<br \/>\n| 8626 | My Rsync Local WordPress Backup Examples (in Win11 I just use Syncback) | 2018-01-27 23:55:39 |<br \/>\n| 7842 | Quickest Cloning of Working Mint System | 2019-06-28 01:39:11 |<br \/>\n| 8583 | Rescue Your System from an MBR corruption? grub rescue&gt; | 2019-06-28 02:19:29 |<br \/>\n| 7855 | GParted's e2fsck -fyvC0 \/dev\/sdx and ntfsresize -ifv \/dev\/sdx | 2019-06-28 18:36:44 |<br \/>\n| 8393 | Manipulating PDFs using PDFTK and PDF-Shuffler | 2020-01-01 06:05:14 |<br \/>\n| 8431 | Thumbdrive Performance Differences V USB SATA disk | 2020-01-14 08:44:45 |<br \/>\n| 8418 | Joining\/Sizing MP4 Video Files | 2020-01-25 04:59:26 |<br \/>\n| 8628 | Converting DVD VOB Files to Smaller VOB and MKV with ffmpeg | 2020-07-29 21:25:05 |<br \/>\n| 8737 | Building A PHP Webpage Input Button for DB Connection | 2022-08-21 00:50:07 |<br \/>\n| 9035 | Equivalent Prime Numbers Programs for Java, Python, C and JScript Testing | 2022-10-07 22:32:53 |<br \/>\n| 9052 | JS, HTML and CSS Todo List - Saves List to JSON File | 2022-10-08 18:02:00 |<br \/>\n| 9083 | CSS Flex Positioning Options | 2022-10-12 15:26:17 |<br \/>\n| 9148 | CSS Grid Layouts | 2022-10-13 13:14:44 |<br \/>\n| 9209 | Functions: Writing and Converting JS Functions to Arrow Functions | 2022-10-18 15:09:11 |<br \/>\n| 9247 | JavaScript: Guess Number Game | 2022-10-21 15:50:35 |<br \/>\n| 9252 | JS: Refactoring the Guess Number Game Code | 2022-10-21 16:16:53 |<br \/>\n| 9267 | JS Behind The Scenes : Hoisting and the TDZ - Temporal Dead Zone | 2022-10-23 18:48:00 |<br \/>\n| 9286 | WebDev Portfolio 1 - First Solo Project - Noughts and Crosses | 2022-11-10 11:53:41 |<br \/>\n| 9292 | WebDev Portfolio 2 \u2013 Fun \"Conspiracy Theory Quiz\" | 2022-11-10 12:14:02 |<br \/>\n| 9349 | Form Validation Types, Results Script and Non Default Web Font Use | 2022-11-10 21:56:34 |<br \/>\n| 9366 | WebDev: Embedded Video Code for Landing Page Link | 2022-11-12 02:34:45 |<br \/>\n| 9606 | Downgrading PHP Versions | 2022-11-16 17:30:14 |<br \/>\n| 9614 | MYSQL DB Repair Commands | 2022-11-17 00:44:51 |<br \/>\n| 9616 | WordPress CLI Commands and some MYSQL Repair Commands | 2022-11-17 14:01:05 |<br \/>\n| 9656 | Uploading Your Local WordPress MYSQL Site to a New Hosting cPanel Site | 2022-11-17 16:27:36 |<br \/>\n| 9624 | WordPress Images Not Showing - Rare Solution | 2022-11-19 15:05:19 |<br \/>\n| 9658 | First Site Pages Speed and SEO Tweaks | 2022-11-20 14:27:02 |<br \/>\n| 9659 | VS Code Live Server SSL Settings | 2022-11-21 17:43:06 |<br \/>\n| 9660 | SSL on Ubuntu Apache2 - Creating Self Signed Certificates, Checking SSL Traffic with TCPDUMP and Wireshark | 2022-11-21 20:58:42 |<br \/>\n| 9680 | Running Apache2, MYSQL and WordPress on Win11 WSL Ubuntu | 2022-11-24 22:31:58 |<br \/>\n| 10098 | Post Titles | 2023-10-29 20:00:16 |<br \/>\n| 10100 | All My IT Tech Post Knowledge - Introduction | 2023-10-29 20:06:16 |<br \/>\n| 10268 | Net Client to Win11 WSL2 Access Fix, with Gemini AI, 2025 | 2025-05-31 08:27:05 |<br \/>\n| 10288 | BitLocker Encryption with Password (No TPM Issues) | 2025-06-02 17:20:55 |<br \/>\n| 10324 | Viewing WordPress Post Name to Number mappings in Linux MYSQL | 2025-06-03 01:19:59 |<br \/>\n| 10346 | Clean Up Duplicate Posts - Gem AI | 2025-06-08 23:47:01 |<br \/>\n| 10368 | Beginner's Guide to N8N and AI Agent Creation - Gemini AI | 2025-06-10 20:22:54 |<br \/>\n| 10371 | Rare Port Conflicts with Win11 Services Stealing Apache Port 80 on Bootup | 2025-06-13 19:07:05 |<br \/>\n| 10375 | Install rclone in WSL2 | 2025-06-14 02:46:00 |<br \/>\n| 10386 | Building a Voice-Activated AI Chatbot for WordPress using Local LLMs | 2025-06-21 18:58:35 |<br \/>\n| 10392 | Help with Systems Fix Steps To Set the AI Environment | 2025-06-23 02:46:27 |<br \/>\n| 10531 | WordPress Site-Wide Content Search Project | 2025-06-23 07:23:10 |<br \/>\n| 10435 | AI Semantic Search Project Summary | 2025-06-28 15:36:39 |<br \/>\n| 10548 | WP Posts Word Count Data Science Exercise | 2025-06-30 23:13:25 |<br \/>\n+-------+------------------------------------------------------------------------------------------------------------+---------------------+<br \/>\n148 rows in set (0.00 sec)<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<ol data-sourcepos=\"26:1-72:0\">\n<li data-sourcepos=\"41:1-53:0\">\n<p data-sourcepos=\"41:5-42:49\"><strong>Clean Up Duplicate Slugs (Carefully!):<\/strong> This is where you need to be very methodical.<\/p>\n<ul data-sourcepos=\"43:5-53:0\">\n<li data-sourcepos=\"43:5-49:177\"><strong>For true duplicates (same content):<\/strong>\n<ul data-sourcepos=\"44:9-49:177\">\n<li data-sourcepos=\"44:9-44:99\">Identify the \"correct\" or canonical post you want to keep. Note its <code>ID<\/code> and <code>post_name<\/code>.<\/li>\n<li data-sourcepos=\"45:9-49:177\">For the duplicate entries (e.g., <code>my-post-2<\/code>, <code>my-post-3<\/code>):\n<ul data-sourcepos=\"46:13-49:177\">\n<li data-sourcepos=\"46:13-48:298\"><strong>Option A (Delete and Redirect):<\/strong>\n<ul data-sourcepos=\"47:17-48:298\">\n<li data-sourcepos=\"47:17-47:202\">Go into the WordPress admin, find the posts with the <code>-2<\/code> suffixes, and <strong>permanently delete them<\/strong> (empty the trash). This will free up the original slug if it was still in the trash.<\/li>\n<li data-sourcepos=\"48:17-48:298\">Once deleted, you will need to set up <strong>301 redirects<\/strong> from the old URLs (e.g., <code>yourdomain.com\/my-post-2\/<\/code>) to the correct URL (e.g., <code>yourdomain.com\/my-post\/<\/code>). You can use a redirection plugin (like \"Redirection\" by John Godley) or manually add rules to your <code>.htaccess<\/code> file.<\/li>\n<\/ul>\n<\/li>\n<li data-sourcepos=\"49:13-49:177\"><strong>Option B (Merge Content):<\/strong> If the content in the duplicates is slightly different, consider merging it into the canonical post and then deleting the duplicates.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<li data-sourcepos=\"50:5-53:0\"><strong>For items that <em>should<\/em> be distinct but have similar names:<\/strong>\n<ul data-sourcepos=\"51:9-53:0\">\n<li data-sourcepos=\"51:9-51:157\">Manually edit the slugs of these posts in the WordPress editor. Change <code>my-report<\/code> to <code>my-report-2024-summary<\/code> or something descriptive and unique.<\/li>\n<li data-sourcepos=\"52:9-53:0\">This avoids the need for redirects if these were genuinely different pieces of content that accidentally got similar slugs.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<li data-sourcepos=\"54:1-56:0\">\n<p data-sourcepos=\"54:5-55:301\"><strong>Check <code>post_status<\/code> and <code>post_type<\/code>:<\/strong> Sometimes, duplicates are caused by posts in the <code>trash<\/code> or <code>draft<\/code> status having the same slug as a live post. Ensure that any slugs in these statuses aren't preventing your live posts from using the desired slug. You can simply empty the trash for posts\/pages if you're sure you don't need them.<\/p>\n<\/li>\n<li data-sourcepos=\"57:1-64:0\">\n<p data-sourcepos=\"57:5-58:96\"><strong>Reset Permalinks in WordPress:<\/strong> After cleaning up your database, you need to tell WordPress to regenerate its rewrite rules.<\/p>\n<ul data-sourcepos=\"59:5-64:0\">\n<li data-sourcepos=\"59:5-59:37\">Go to your WordPress Dashboard.<\/li>\n<li data-sourcepos=\"60:5-60:44\">Navigate to <strong>Settings &gt; Permalinks<\/strong>.<\/li>\n<li data-sourcepos=\"61:5-61:119\">Even if \"Post Name\" is selected, select a different permalink structure (e.g., \"Plain\") and click \"Save Changes.\"<\/li>\n<li data-sourcepos=\"62:5-62:82\">Then, immediately switch back to \"Post Name\" and click \"Save Changes\" again.<\/li>\n<li data-sourcepos=\"63:5-64:0\">This action forces WordPress to flush its rewrite rules and regenerate the <code>.htaccess<\/code> file, which should now reflect the cleaned-up, unique slugs.<\/li>\n<\/ul>\n<\/li>\n<li data-sourcepos=\"65:1-67:0\">\n<p data-sourcepos=\"65:5-66:285\"><strong>Clear Caching:<\/strong> If you're using any caching plugins (e.g., WP Super Cache, W3 Total Cache, LiteSpeed Cache) or server-level caching (e.g., Cloudflare, hosting provider cache), <strong>clear all caches<\/strong> thoroughly. Old cached versions of your pages can prevent the new permalinks from working correctly.<\/p>\n<\/li>\n<li data-sourcepos=\"68:1-72:0\">\n<p data-sourcepos=\"68:5-68:24\"><strong>Test Thoroughly:<\/strong><\/p>\n<ul data-sourcepos=\"69:5-72:0\">\n<li data-sourcepos=\"69:5-69:111\">Test existing posts and pages to ensure they are now accessible with the \"Post Name\" permalink structure.<\/li>\n<li data-sourcepos=\"70:5-70:128\">Test posts that previously had <code>-2<\/code> or similar suffixes to ensure they redirect correctly or load their new, unique slugs.<\/li>\n<li data-sourcepos=\"71:5-72:0\">Check your site's main navigation and any internal links.<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p data-sourcepos=\"73:1-73:62\"><strong>Advanced Considerations (If the above doesn't fully work):<\/strong><\/p>\n<ul data-sourcepos=\"75:1-78:0\">\n<li data-sourcepos=\"75:1-75:372\"><strong>Database Search &amp; Replace:<\/strong> If you have many broken internal links pointing to the old, numbered permalinks, you might need to run a database search and replace operation to update those internal links. Be extremely careful with this, and always use a plugin like \"Better Search Replace\" for safety, rather than direct SQL queries unless you are very experienced.<\/li>\n<li data-sourcepos=\"76:1-76:358\"><strong>Check <code>wp_options<\/code> table for <code>rewrite_rules<\/code>:<\/strong> In rare cases, the <code>rewrite_rules<\/code> option in your <code>wp_options<\/code> table might be corrupted. Resetting permalinks usually fixes this, but you could, as a last resort, temporarily delete this option to force WordPress to rebuild it completely. <strong>Do this only if other methods fail and you have a solid backup.<\/strong><\/li>\n<li data-sourcepos=\"77:1-78:0\"><strong>Plugin Conflicts:<\/strong> While less likely to directly cause your \"multiple numbers for the same post name\" issue, a plugin could interfere with permalink generation. If issues persist, try deactivating all plugins and reactivating them one by one to rule out conflicts.<\/li>\n<\/ul>\n<p data-sourcepos=\"79:1-79:174\">Given the history of \"many mistakes in MySQL import and exports,\" this is likely a database-centric problem. Be patient, work methodically, and prioritize backups. Good luck!<\/p>\n<div class=\"user-query-container user-query-bubble-container ng-star-inserted\">\n<div id=\"user-query-content-3\" class=\"query-content ng-star-inserted\">\n<div class=\"query-text gds-body-l\" dir=\"ltr\" role=\"heading\" aria-level=\"2\">\n<p class=\"query-text-line ng-star-inserted\">That is weird, just running your commands seems to have fixed the Permalink Names issue! thanks<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div>\n<div class=\"response-container ng-tns-c2580058953-40 response-container-with-gpi ng-star-inserted response-container-has-multiple-responses\">\n<div class=\"presented-response-container ng-tns-c2580058953-40\">\n<div class=\"response-container-content ng-tns-c2580058953-40\">\n<div class=\"response-content ng-tns-c2580058953-40\">\n<div id=\"model-response-message-contentr_b9dee101a9ca9796\" class=\"markdown markdown-main-panel stronger enable-updated-hr-color\" dir=\"ltr\">\n<p data-sourcepos=\"1:1-1:129\">That's fantastic news! I'm genuinely happy to hear that simply running the commands seems to have resolved your permalink issues.<\/p>\n<p data-sourcepos=\"3:1-3:77\">It's actually not as weird as it might seem. Here's why that likely happened:<\/p>\n<ul data-sourcepos=\"5:1-8:0\">\n<li data-sourcepos=\"5:1-5:413\"><strong>Forcing a Database Check:<\/strong> When you execute SQL queries like <code>SELECT ID, post_name, post_status, post_date FROM wp_xubg_posts WHERE post_name = 'your-slug'<\/code>, you're essentially prompting the database to look closely at those specific entries. While it doesn't directly <em>change<\/em> anything, it can sometimes jolt the database's internal indexing or cache, especially if there were minor, latent inconsistencies.<\/li>\n<li data-sourcepos=\"6:1-6:309\"><strong>phpMyAdmin's Implicit Actions:<\/strong> Simply Browse tables or running queries in phpMyAdmin can sometimes trigger internal database optimizations or re-indexing, which might clear up minor corruption or inconsistencies that were preventing WordPress from correctly interpreting the <code>post_name<\/code> to <code>ID<\/code> mapping.<\/li>\n<li data-sourcepos=\"7:1-8:0\"><strong>WordPress Permalink Flush:<\/strong> Even if you didn't explicitly go to Settings &gt; Permalinks and resave them, sometimes the act of the database being accessed and potentially \"cleaned\" by your queries can cause WordPress's internal rewrite rules to refresh slightly, especially if the site was already on \"Post Name\" permalinks. The system might have now found the correct canonical post it was looking for.<\/li>\n<\/ul>\n<p data-sourcepos=\"9:1-9:148\">Regardless of the exact technical reason, the most important thing is that your site is now functioning as expected with the \"Post Name\" permalinks!<\/p>\n<p data-sourcepos=\"11:1-11:128\">This is a great outcome, and it saves you the more involved process of manual deletion, slug renaming, and setting up redirects.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<div class=\"pvc_clear\"><\/div>\n<p id=\"pvc_stats_10346\" class=\"pvc_stats all  \" data-element-id=\"10346\" style=\"\"><i class=\"pvc-stats-icon medium\" aria-hidden=\"true\"><svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"far\" data-icon=\"chart-bar\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\" class=\"svg-inline--fa fa-chart-bar fa-w-16 fa-2x\"><path fill=\"currentColor\" d=\"M396.8 352h22.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-192 0h22.4c6.4 0 12.8-6.4 12.8-12.8V140.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h22.4c6.4 0 12.8-6.4 12.8-12.8V204.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zM496 400H48V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zm-387.2-48h22.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8z\" class=\"\"><\/path><\/svg><\/i> <img loading=\"lazy\" decoding=\"async\" width=\"16\" height=\"16\" alt=\"Loading\" src=\"https:\/\/stevepedwards.today\/DebianAdmin\/wp-content\/plugins\/page-views-count\/ajax-loader-2x.gif\" border=0 \/><\/p>\n<div class=\"pvc_clear\"><\/div>\n<p>Identify Duplicate Slugs: Go to the wp_posts table (your table prefix might be different, e.g., wp_xyz_posts). Look at the post_name column. You're looking for entries like my-post, my-post-2, my-post-3, etc., where the content is essentially the same or one is an older, now-obsolete version. You can run SQL queries to help identify these. For example: <a href=\"https:\/\/stevepedwards.today\/DebianAdmin\/clean-up-duplicate-posts-gem-ai\/\" class=\"more-link\">...<span class=\"screen-reader-text\">\u00a0 Clean Up Duplicate Posts &#8211; Gem AI<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-10346","post","type-post","status-publish","format-standard","hentry","category-post"],"a3_pvc":{"activated":true,"total_views":2,"today_views":0},"_links":{"self":[{"href":"https:\/\/stevepedwards.today\/DebianAdmin\/wp-json\/wp\/v2\/posts\/10346","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/stevepedwards.today\/DebianAdmin\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/stevepedwards.today\/DebianAdmin\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/stevepedwards.today\/DebianAdmin\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/stevepedwards.today\/DebianAdmin\/wp-json\/wp\/v2\/comments?post=10346"}],"version-history":[{"count":13,"href":"https:\/\/stevepedwards.today\/DebianAdmin\/wp-json\/wp\/v2\/posts\/10346\/revisions"}],"predecessor-version":[{"id":10567,"href":"https:\/\/stevepedwards.today\/DebianAdmin\/wp-json\/wp\/v2\/posts\/10346\/revisions\/10567"}],"wp:attachment":[{"href":"https:\/\/stevepedwards.today\/DebianAdmin\/wp-json\/wp\/v2\/media?parent=10346"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/stevepedwards.today\/DebianAdmin\/wp-json\/wp\/v2\/categories?post=10346"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/stevepedwards.today\/DebianAdmin\/wp-json\/wp\/v2\/tags?post=10346"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}