Support » Fixing WordPress » Is there a way to bulk uncheck “Post in new information” for all Products?

  • Resolved franz117

    (@franz117)


    Hi Community,

    first post here. I hope I am doing everything correctly.

    So I am working, as an intern, for a Japanese client at the moment.
    One thing I noticed is that they have 2 different sites in their drop-down menu:

    https://imgur.com/fXtbqv2

    New Arrivals and Products. Basically they have a product archive online with pictures.
    One site is supposed to show the newest products and on the other one all of them/the rest.

    Now the thing is that they both show exactly the same content. That’s because they are the same
    website, just with a “taxonomy filter applied” (not sure if that’s the right expression).

    https://i.imgur.com/Wue1vbY.png
    https://i.imgur.com/fD6naO5.png

    So I figured out that if I go and edit one of the product pages and uncheck
    “post in new information” the product is gone from the “New Arrival” Page.

    https://i.imgur.com/fO8Wx2m.png

    So basically every product which got added to the site in the last couple of years has this “New Information” thing checked.
    I do not want to go manually through hundreds of products and uncheck them all.

    Is there a way to uncheck all of them at once?

    I tried using a plugin, but they only worked for taxonomies and types.

    The thing is, “?type=arrival” is not a type they set up in WordPress. It is not a taxonomy either.

    • This topic was modified 1 year, 4 months ago by franz117.
    • This topic was modified 1 year, 4 months ago by franz117.
    • This topic was modified 1 year, 4 months ago by franz117.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Hello @franz117,

    It will be possible, if you have access the phpmyadmin,then update the query for that.

    Thanks

    Thread Starter franz117

    (@franz117)

    @mignobt It’s a custom theme based on the Enigma Theme. I think it’s nothing fancy really 😀

    Thread Starter franz117

    (@franz117)

    Hey @anant101289,

    thank you for the tip!
    You mean I should write a custom SQL query to address all of them at once and change the value, right?
    Yes, good thing I have access to PHPmyAdmin.

    So I was looking at a single post to find out the name of the field I need to change however, I could not find the field that corresponds to the “new Information” checkbox.

    I exported the table as text: You can see it here:

    https://imgur.com/jW9o0Gm

    I even compared two posts, one in which I unchecked the “new Information” box and the other I left it. I could not see any difference when looking at them through PHPMyAdmin.

    I hope you have another idea for me.

    I prepared the SQL Statement. It should look something like this, right?

    UPDATE wp_posts
    SET <???> = <0> (Or maybe boolean?) <false>
    WHERE post_type = products;

    Now I have to be really careful with SQL and the DB, right? There is no undo button if I run a bad/wrong query, correct?

    Thank you for the quick response and have a nice day!

    • This reply was modified 1 year, 4 months ago by franz117.
    • This reply was modified 1 year, 4 months ago by franz117.

    Hello @franz117,

    I think that data save in post_meta table, please check post_meta table and confirm.

    Update Query

    UPDATE wp_postmeta
    SET meta_value = “”
    WHERE meta_key like ‘ ‘ AND post_id = ;

    Where post_id == product post id.

    Thanks

    Thread Starter franz117

    (@franz117)

    Hey @anant101289,

    I did it! Thank you very much.

    So here is what I did:

    First I made a backup from the SQL DB by clicking on export in PHPMyAdmin and saving it as a ZIP.

    Then I wrote the SQL Statement which was this:

    UPDATE wp_postmeta
    SET meta_value =0
    WHERE meta_key =”new_arrival”

    I had to put meta_value and meta_key in
    double `(like “meta_value”)
    but the formating here deletes the single quotation marks and makes a box around it.

    Since I wanted all to be “not new” I did this.
    Then I manually clicked checked the newest products on the page in WordPress.
    When new items will come out I will probably remove the checks in the boxes again (because they are only a few) and add them for the new products.

    Thank you again for your help!

    Edit: Formatting

    • This reply was modified 1 year, 4 months ago by franz117.
    • This reply was modified 1 year, 4 months ago by franz117.
    • This reply was modified 1 year, 4 months ago by franz117.
    • This reply was modified 1 year, 4 months ago by franz117.
    • This reply was modified 1 year, 4 months ago by franz117.
    • This reply was modified 1 year, 4 months ago by franz117.
    • This reply was modified 1 year, 4 months ago by franz117.
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Is there a way to bulk uncheck “Post in new information” for all Products?’ is closed to new replies.