D
Deleted member 832639
Guest
I've started learning QA automation recently. I also have a couple of AI websites, and there's an urgent question for many of us: how to automate internal linking.
I've been using Linkwhisper for a while, and I like it. However, as I accumulated more articles, it became quite challenging to click all the buttons manually. Moreover, it's not just about clicking; I have to wait for the page to load for quite a while.
That's why I decided to come up with a quick solution for myself and share it with you, guys.
So, here's what we need:
a Link Whisper (I'm using a version 2.1.6 pro) and Python with the Selenium module.
What are we doing?
In Linkwhisper, you can assign outgoing links or incoming ones. We won't be able to control outgoing links too much, but we want at least a couple of links on every article (I decided on 5, but you can adjust it as you want), yet not too many. Whisper offers all possible options.
So, we go to the plugin settings: Link Whisper Settings - general settings - scroll all the way down - Max Number of Suggestions to Display, set it to 5.
Now you'll only get 5 suggestions, not all of them.

Check your posts list; it should look like mine - 20 posts per page and the link stats block.

Now, install Python, the Selenium module, copy the script like mine, change the site name, login, and password, input your data, and enjoy.
The script will go through 100 pages (you can set more if you want), 20 articles per page, and add 5 links each. It will take a lot of time, but it works.
I also want to mention that the script skips posts where there are already 5 links.
Thanks to everyone, and good luck with your cool earnings.
I've been using Linkwhisper for a while, and I like it. However, as I accumulated more articles, it became quite challenging to click all the buttons manually. Moreover, it's not just about clicking; I have to wait for the page to load for quite a while.
That's why I decided to come up with a quick solution for myself and share it with you, guys.
So, here's what we need:
a Link Whisper (I'm using a version 2.1.6 pro) and Python with the Selenium module.
What are we doing?
In Linkwhisper, you can assign outgoing links or incoming ones. We won't be able to control outgoing links too much, but we want at least a couple of links on every article (I decided on 5, but you can adjust it as you want), yet not too many. Whisper offers all possible options.
So, we go to the plugin settings: Link Whisper Settings - general settings - scroll all the way down - Max Number of Suggestions to Display, set it to 5.
Now you'll only get 5 suggestions, not all of them.

Check your posts list; it should look like mine - 20 posts per page and the link stats block.

Now, install Python, the Selenium module, copy the script like mine, change the site name, login, and password, input your data, and enjoy.
The script will go through 100 pages (you can set more if you want), 20 articles per page, and add 5 links each. It will take a lot of time, but it works.
I also want to mention that the script skips posts where there are already 5 links.
Code:
import time
from selenium import webdriver
driver = webdriver.Chrome()
from selenium.webdriver.common.by import By
driver.maximize_window()
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
driver.implicitly_wait(5)
#website admin url
driver.get("https://yourwebsite.com/wp-admin")
time.sleep(2)
#login and password
name = driver.find_element(By.ID, "user_login")
name.send_keys("login")
password = driver.find_element(By.ID, "user_pass")
password.send_keys("password")
btn = driver.find_element(By.ID, "wp-submit")
btn.click()
time.sleep(1)
for i in range(1,100):
driver.get(f"https://yourwebsite.com/wp-admin/edit.php?paged={i}") #website
time.sleep(2)
for n in range(1,21):
textel = driver.find_element(By.XPATH, f"//tbody/tr[{n}]/td[17]/span/span/a/span[2]")
text = textel.text
if text == "0":
linkbtn = driver.find_element(By.XPATH, f"//tbody/tr[{n}]/td[17]/span/span/a")
link = linkbtn.get_attribute("href")
driver.get(link)
add = WebDriverWait(driver, 120).until(EC.presence_of_element_located((By.ID, "select_all")))
add.click()
btn = driver.find_element(By.ID, "inbound_suggestions_button")
btn.click()
WebDriverWait(driver, 60).until(EC.presence_of_element_located((By.CLASS_NAME, "swal-button--confirm")))
driver.get(f"https://yourwebsite.com/wp-admin/edit.php?paged={i}") #website
time.sleep(2)
else:
print("skip")
time.sleep(10)
print("END")
Thanks to everyone, and good luck with your cool earnings.
