Ajax loading duplicate post

You have got a few things to consider here. Let’s start the way the Browser does. You build up the HTML, so far so good, containing the Structure and everything for your site. No articles are shown. The next step your Browser has to do is make the AJAX call. Here are the first things … Read more

Duplicate posts when posting nulls in records in phpMyAdmin [closed]

Problem is within function query_abstract_post_table where you have ‘$ids’ wrapped in single quotes: Problem: $sql = “SELECT * FROM $table_name WHERE ID NOT IN (‘$ids’)”; In the above example, only the first ID returned in the concatenated string (from the array) will be recognized by the NOT IN clause. Solution: $sql = “SELECT * FROM … Read more

How to append unique numbers to new duplicated post titles/urls?

Filter wp_unique_post_slug. Make sure to add the callback with 6 as last argument to get the original slug. Then create a new unique slug as you need it, you get a lot of context information. add_filter( ‘wp_unique_post_slug’, function ( $slug, $post_ID, $post_status, $post_type, $post_parent, $original_slug ) { // create a new unique slug based on … Read more

Auto-create a pretty permalink for a bunch of posts

Editing the permalink manually would be the safest route. If you’re comfortable using phpMyAdmin, you could create a MySQL query to update them all in one batch. Slightly more work than auto-assigning a slug, but it doesn’t require a lot of coding to try to re-calculate the slugs. update wp_posts SET post_name=”new-slug” WHERE post_name=”old-slug”; (You … Read more